Skip to content

Commit f8cc6fc

Browse files
committed
Fix ElevenLabs Synthesis Progress
Before it wasn't showing the actual progress it was on
1 parent 047bc13 commit f8cc6fc

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Scripts/TTS.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,11 @@ async def synthesize_dictionary_async(subsDict, langDict, skipSynthesize=False,
481481
total_tasks = len(subsDict)
482482
errorsOccured = False
483483

484-
print("Beginning TTS Synthesis...")
484+
print("Beginning Text-To-Speech Audio Synthesis...")
485+
485486
async def synthesize_and_save(key, value):
486487
nonlocal progress
487-
488-
# Update and display progress
489-
async with lock:
490-
progress += 1
491-
print(f" Synthesizing TTS: {progress} of {total_tasks}", end="\r")
492-
488+
493489
# Use this to set max concurrent jobs
494490
async with semaphore:
495491
audio = await synthesize_text_elevenlabs_async_http(
@@ -508,6 +504,11 @@ async def synthesize_and_save(key, value):
508504
errorsOccured = True
509505
subsDict[key]['TTS_FilePath'] = "Failed"
510506

507+
# Update and display progress after task completion
508+
async with lock:
509+
progress += 1
510+
print(f" TTS Progress: {progress} of {total_tasks}", end="\r")
511+
511512
tasks = []
512513

513514
for key, value in subsDict.items():
@@ -527,6 +528,7 @@ async def synthesize_and_save(key, value):
527528
print("Synthesis Finished")
528529
return subsDict
529530

531+
530532
def synthesize_dictionary(subsDict, langDict, skipSynthesize=False, secondPass=False):
531533
for key, value in subsDict.items():
532534
# TTS each subtitle text, write to file, write filename into dictionary

0 commit comments

Comments
 (0)