Update Standalone API - race condition fix
Applies the same race condition fix for narrator/character that potentially existed, but for the standalone mode API. Will have zero effect for anyone not using the API
This commit is contained in:
1 parent
f83e7c3b4e
commit
94f5b781cc
1 file changed
+2
-1
+2
-1
@@ -624,6 +624,7 @@ async def get_audio(filename: str):
|
||||
########################
|
||||
import html
|
||||
import re
|
||||
import uuid
|
||||
import numpy as np
|
||||
import soundfile as sf
|
||||
from typing import Union, Dict
|
||||
@@ -802,7 +803,7 @@ async def tts_generate(
|
||||
print("ELSE - NARRATOR\n")
|
||||
cleaned_part = html.unescape(part.replace('< ', '').replace('< ', '').replace('< ', ''))
|
||||
voice_to_use = narrator_voice_gen
|
||||
output_file = this_dir / "outputs" / f"{output_file_name}_{int(time.time())}_{i}.wav"
|
||||
output_file = this_dir / "outputs" / f"{output_file_name}_{uuid.uuid4()}_{int(time.time())}_{i}.wav"
|
||||
output_file_str = output_file.as_posix()
|
||||
await generate_audio(cleaned_part, voice_to_use, language, output_file_str)
|
||||
audio_path = output_file_str
|
||||
|
||||
Reference in new issue
Block a user