Spaces:
Runtime error
Runtime error
normalize audio
Browse files
main.py
CHANGED
@@ -47,7 +47,9 @@ async def merge_audio(output_key: str):
|
|
47 |
input_file = 'list.txt'
|
48 |
|
49 |
try:
|
50 |
-
|
|
|
|
|
51 |
except Exception as e:
|
52 |
raise HTTPException(status_code=500, detail=f"FFmpeg Error: {e}")
|
53 |
|
|
|
47 |
input_file = 'list.txt'
|
48 |
|
49 |
try:
|
50 |
+
intermediate_output = temp_dir + 'intermediate_output.mp3'
|
51 |
+
ffmpeg.input(input_file, format='concat', safe=0).output(intermediate_output, c='copy').run()
|
52 |
+
ffmpeg.input(intermediate_output).audio.filter('loudnorm').output(output_file, audio_bitrate='256k', ar='44100').run()
|
53 |
except Exception as e:
|
54 |
raise HTTPException(status_code=500, detail=f"FFmpeg Error: {e}")
|
55 |
|