Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -60,8 +60,8 @@ async def text_to_audio_and_srt(text, voice, rate, pitch):
|
|
60 |
audio_clips = []
|
61 |
subtitle_chunks = []
|
62 |
|
63 |
-
# Generate audio for each
|
64 |
-
for i in range(0, len(words), 3): #
|
65 |
chunk = ' '.join(words[i:i + 3]) # Create a chunk of 3 words
|
66 |
audio, warning = await text_to_speech(chunk, voice, rate, pitch)
|
67 |
if warning:
|
|
|
60 |
audio_clips = []
|
61 |
subtitle_chunks = []
|
62 |
|
63 |
+
# Generate audio for each word and adjust chunk size dynamically
|
64 |
+
for i in range(0, len(words), 3): # Initial chunk size of 3 words
|
65 |
chunk = ' '.join(words[i:i + 3]) # Create a chunk of 3 words
|
66 |
audio, warning = await text_to_speech(chunk, voice, rate, pitch)
|
67 |
if warning:
|