hivecorp commited on
Commit
a2b6969
·
verified ·
1 Parent(s): 3ae4583

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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 3-4 word chunk
64
- for i in range(0, len(words), 3): # Change the step to 3 or 4 based on your preference
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: