hivecorp commited on
Commit
8fc1d5a
·
verified ·
1 Parent(s): c14c0c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -118,11 +118,13 @@ async def batch_process_srt_and_audio(script_text, pitch, progress=gr.Progress()
118
 
119
  # Generate unique names for the final files
120
  unique_id = uuid.uuid4()
121
- final_audio_path = f"final_audio_{unique_id}.wav"
122
  final_srt_path = f"final_subtitles_{unique_id}.srt"
123
 
124
- # Export combined audio and validated SRT with unique names
125
- combined_audio.export(final_audio_path, format="wav")
 
 
126
  with open(final_srt_path, "w") as srt_file:
127
  srt_file.write(validated_srt_content)
128
 
 
118
 
119
  # Generate unique names for the final files
120
  unique_id = uuid.uuid4()
121
+ final_audio_path = f"final_audio_{unique_id}.mp3" # Set to MP3
122
  final_srt_path = f"final_subtitles_{unique_id}.srt"
123
 
124
+ # Export combined audio directly as MP3 with 320 kbps bitrate
125
+ combined_audio.export(final_audio_path, format="mp3", bitrate="320k")
126
+
127
+ # Export validated SRT with unique names
128
  with open(final_srt_path, "w") as srt_file:
129
  srt_file.write(validated_srt_content)
130