我想在 linux 中使用 SOX 混合音频。这是我的脚本。我是这件事的初学者。
time sox --buffer 128000 --combine mix audio1.mp3 audio_recorded.wav -C 64.0 "./Mixed.mp3"
time ffmpeg -loglevel warning -i ./Output.wav -c:a libfdk_aac -b:a 64k -map 0:0 -f segment -segment_time 10 -segment_list ./Output.m3u8 -segment_format aac './stream%03d.aac'
cd ..
但结果是这样的..
sox FAIL formats: can't open input file `audio_recorded.wav': WAVE: RIFF header not found
real 0m0.003s
user 0m0.000s
sys 0m0.002s
这audio_recorded.wav
是从android录制的音频文件。
[删除安卓代码:不再需要]
更新:我试图修改我的录音机..设置比特率和采样率与 audio1.mp3 相同。然后我试着混合它。这就是现在发生的事情:
[root@app complete]# bash test_mix.sh
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: recoverable MAD error
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox WARN mp3-util: MAD lost sync
sox FAIL formats: can't open input file `sound997309159.mp3':
real 0m0.005s
user 0m0.002s
sys 0m0.002s
我设置了录制的采样率和比特率,因为当我尝试在 sox 中混合它时,它提示我文件没有相同的通道和比特率。