Update app.py
Browse files
app.py
CHANGED
@@ -356,11 +356,10 @@ def generate_voiceover_OpenAI(translated_json, language, output_audio_path):
|
|
356 |
voice=voice,
|
357 |
input=full_text
|
358 |
)
|
359 |
-
|
360 |
# Save the audio to the specified path
|
361 |
-
with open(output_audio_path,
|
362 |
-
|
363 |
-
|
364 |
logging.info(f"Voiceover generated successfully for {output_audio_path}")
|
365 |
break
|
366 |
|
|
|
356 |
voice=voice,
|
357 |
input=full_text
|
358 |
)
|
|
|
359 |
# Save the audio to the specified path
|
360 |
+
with open(output_audio_path, 'wb') as f:
|
361 |
+
for chunk in response.iter_bytes():
|
362 |
+
f.write(chunk)
|
363 |
logging.info(f"Voiceover generated successfully for {output_audio_path}")
|
364 |
break
|
365 |
|