更新:您也可以使用 ffmpeg
方法 1:
https
://github.com/adaptlearning/adapt_authoring/wiki/Installing-FFmpeg#installing-ffmpeg-in-ubuntu
bash
ffmpeg -i path/to/3gp.3gp path/to/wav.wav
或
python(运行 bash 命令)
import os
os.system('ffmpeg -i path/to/3gp.3gp path/to/wav.wav')
方法 2:
将 .3gp 转换为 .mp3,然后将 .mp3 转换为 .wav
使用https://pypi.org/project/ftransc/将 .3gp 转换为 .mp3。目前没有python API,所以要么使用
- bash
ftransc -f mp3 filename.3gp
给出目的地 - 检查帮助
或
- Python
os.system('ftransc -f mp3 filename.3gp')
然后使用pydub https://github.com/jiaaro/pydub#installation将.mp3 转换成.wav
newAudio = AudioSegment.from_mp3('path/to/mp3')
newAudio.export('path/to/destination.wav', format="wav")