Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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}.
|
| 122 |
final_srt_path = f"final_subtitles_{unique_id}.srt"
|
| 123 |
|
| 124 |
-
# Export combined audio
|
| 125 |
-
combined_audio.export(final_audio_path, format="
|
|
|
|
|
|
|
| 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 |
|