qqwjq1981 commited on
Commit
15a8996
·
verified ·
1 Parent(s): 5ec5fe4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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, "wb") as f:
362
- f.write(response['audio'])
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