Update uuid to avoid possible race condition
file naming on short sentences could possibly have a race condition. set uuid as opposed to timestamp to avoid this outcome.
This commit is contained in:
1 parent
c92aa435e5
commit
dc9d343115
1 file changed
+2
-3
@@ -618,11 +618,10 @@ def output_modifier(string, state):
|
|||||||
|
|
||||||
|
|
||||||
def get_output_filename(state):
|
def get_output_filename(state):
|
||||||
# Check if character name exists and if not, just call it TTSOUT_
|
|
||||||
if "character_menu" in state:
|
if "character_menu" in state:
|
||||||
return Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{int(time.time())}.wav').as_posix()
|
return Path(f'{params["output_folder_wav"]}/{state["character_menu"]}_{str(uuid.uuid4())[:8]}.wav').as_posix()
|
||||||
else:
|
else:
|
||||||
return Path(f'{params["output_folder_wav"]}/TTSOUT_{int(time.time())}.wav').as_posix()
|
return Path(f'{params["output_folder_wav"]}/TTSOUT_{str(uuid.uuid4())[:8]}.wav').as_posix()
|
||||||
|
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
|
|||||||
Reference in new issue
Block a user