I am attempting to convert an .mp3 testaudio.mp3
into .wav testaudio.wav
by using Python's subprocess module and ffmpeg.
I am on Windows, and when I use command prompt to run the following command, it works and converts my .mp3 into .wav successfully:
C:\PATH_programs\ffmpeg-4.4-full_build\ffmpeg-4.4-full_build\bin>ffmpeg -i testaudio.mp3 testaudio.wav
However, when I attempt to use a Python script to do the same thing, I get a "No such file or directory"
error:
import subprocess
subprocess.call(['ffmpeg', '-i', 'testaudio.mp3', 'testaudio.wav'])
The ffmpeg.exe
, convertmp3towav.py
, and audiotest.mp3
files all live in the same directory C:\PATH_programs\ffmpeg-4.4-full_build\ffmpeg-4.4-full_build\bin
.