Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
@@ -31,15 +31,13 @@ def generate_audio_chunks(text: str, language: str, chunk_size: int = 20) -> Gen
|
|
31 |
|
32 |
for idx, chunk in enumerate(text_chunks):
|
33 |
# Generate audio for each chunk and yield as bytes
|
34 |
-
audio_buffer = BytesIO()
|
35 |
tts.tts_to_file(
|
36 |
text=chunk,
|
37 |
-
file_path=
|
38 |
speaker_wav=FIXED_SPEAKER_WAV,
|
39 |
language=language
|
40 |
)
|
41 |
-
|
42 |
-
yield audio_buffer.read()
|
43 |
|
44 |
@app.post("/generate-audio/")
|
45 |
async def generate_audio(
|
|
|
31 |
|
32 |
for idx, chunk in enumerate(text_chunks):
|
33 |
# Generate audio for each chunk and yield as bytes
|
|
|
34 |
tts.tts_to_file(
|
35 |
text=chunk,
|
36 |
+
file_path=f"out_{idx}.wav",
|
37 |
speaker_wav=FIXED_SPEAKER_WAV,
|
38 |
language=language
|
39 |
)
|
40 |
+
yield f"out_{idx}.wav"
|
|
|
41 |
|
42 |
@app.post("/generate-audio/")
|
43 |
async def generate_audio(
|