from os import path
from pydub import AudioSegment
input_file = "audio.mp3"
output_file = "result.wav"
sound = AudioSegment.from_mp3(input_file)
sound.export(output_file, format="wav")
当我运行上面的代码时。它显示以下错误。
FileNotFoundError: No such file or directory: 'ffprobe'
我也使用 subprocess 模块尝试过这个。
input_file = "audio.mp3"
output_file = "result.wav"
import subprocess
subprocess.call(['ffmpeg', '-i', input_file, output_file])
它给出以下错误
FileNotFoundError: No such file or directory: 'ffmpeg'
我不确定这段代码有什么问题。我目前使用的是 Windows 10。请解决这个问题。
答案 0 :(得分:0)
从 https://ffmpeg.org/download.html 下载 ffmpeg 并将库添加到您的系统中。
可能与 FileNotFoundError: [Errno 2] No such file or directory: 'ffprobe': 'ffprobe' 重复