使用 python 和 ffmpeg 轉換任何聲音檔案
from subprocess import check_call
ok = check_call(['ffmpeg','-i','input.mp3','output.wav'])
if ok:
with open('output.wav', 'rb') as f:
wav_file = f.read()
注意:
from subprocess import check_call
ok = check_call(['ffmpeg','-i','input.mp3','output.wav'])
if ok:
with open('output.wav', 'rb') as f:
wav_file = f.read()
注意: