@@ -481,15 +481,11 @@ async def synthesize_dictionary_async(subsDict, langDict, skipSynthesize=False,
481
481
total_tasks = len (subsDict )
482
482
errorsOccured = False
483
483
484
- print ("Beginning TTS Synthesis..." )
484
+ print ("Beginning Text-To-Speech Audio Synthesis..." )
485
+
485
486
async def synthesize_and_save (key , value ):
486
487
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
+
493
489
# Use this to set max concurrent jobs
494
490
async with semaphore :
495
491
audio = await synthesize_text_elevenlabs_async_http (
@@ -508,6 +504,11 @@ async def synthesize_and_save(key, value):
508
504
errorsOccured = True
509
505
subsDict [key ]['TTS_FilePath' ] = "Failed"
510
506
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
+
511
512
tasks = []
512
513
513
514
for key , value in subsDict .items ():
@@ -527,6 +528,7 @@ async def synthesize_and_save(key, value):
527
528
print ("Synthesis Finished" )
528
529
return subsDict
529
530
531
+
530
532
def synthesize_dictionary (subsDict , langDict , skipSynthesize = False , secondPass = False ):
531
533
for key , value in subsDict .items ():
532
534
# TTS each subtitle text, write to file, write filename into dictionary
0 commit comments