Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -203,7 +203,7 @@ async def transcript_to_speech(transcript_text, voice, rate, pitch):
|
|
203 |
max_end_time_ms = 0
|
204 |
previous_end_time_ms = 0
|
205 |
previous_start_time_ms = 0 # Keep track of the *start* time of the previous segment
|
206 |
-
|
207 |
|
208 |
for i, line in enumerate(lines):
|
209 |
start_time, audio_paths = await process_transcript_line(line, voice, rate, pitch)
|
@@ -227,6 +227,7 @@ async def transcript_to_speech(transcript_text, voice, rate, pitch):
|
|
227 |
if current_audio_duration > time_difference:
|
228 |
intended_start_time = previous_end_time_ms
|
229 |
|
|
|
230 |
timed_audio_segments.append({'start': intended_start_time, 'audio': combined_line_audio})
|
231 |
previous_start_time_ms = start_time #update previous start time
|
232 |
previous_end_time_ms = max(previous_end_time_ms, intended_start_time + current_audio_duration)
|
@@ -304,3 +305,4 @@ async def create_demo():
|
|
304 |
if __name__ == "__main__":
|
305 |
demo = asyncio.run(create_demo())
|
306 |
demo.launch()
|
|
|
|
203 |
max_end_time_ms = 0
|
204 |
previous_end_time_ms = 0
|
205 |
previous_start_time_ms = 0 # Keep track of the *start* time of the previous segment
|
206 |
+
next_start_time_ms = None # Keep track of the *start* time of the next segment
|
207 |
|
208 |
for i, line in enumerate(lines):
|
209 |
start_time, audio_paths = await process_transcript_line(line, voice, rate, pitch)
|
|
|
227 |
if current_audio_duration > time_difference:
|
228 |
intended_start_time = previous_end_time_ms
|
229 |
|
230 |
+
|
231 |
timed_audio_segments.append({'start': intended_start_time, 'audio': combined_line_audio})
|
232 |
previous_start_time_ms = start_time #update previous start time
|
233 |
previous_end_time_ms = max(previous_end_time_ms, intended_start_time + current_audio_duration)
|
|
|
305 |
if __name__ == "__main__":
|
306 |
demo = asyncio.run(create_demo())
|
307 |
demo.launch()
|
308 |
+
|