I am trying to use a simple program to convert a .MP3 file to a .WAV file in python:
from os import path
from pydub import AudioSegment
src = "test1.mp3"
dst = "test1.wav"
# convert wav to mp3
sound = AudioSegment.from_mp3(src)
sound.export(dst, format="wav")
When I try to run the program in an IDE, I am getting a FileNotFoundError this is what the StackTrace looks like:
RuntimeWarning: Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work
warn("Couldn't find ffprobe or avprobe - defaulting to ffprobe, but may not work", RuntimeWarning)
...
[Errno 2] No such file or directory: 'ffprobe': 'ffprobe'
I know this error means that the IDE is not able to locate my FFMPEG (because it is not in the correct path). I downloaded FFMPEG, FFPROBE is located in the FFMPEG library using:
pip install FFMPEG
However, even when I try to run the program from the command line using
python soundtest.py
I am getting another FileNotFoundError:
File "soundtest.py", line 13, in <module>
with open('simple.html') as html_file:
FileNotFoundError: [Errno 2] No such file or directory: 'simple.html'
I am not sure why this is happening because despite FFMPEG not being in the correct path to be accessed by the IDE I cannot run it from the command line either.
Ideally, I would like to add the FFMPEG library to the system path so that it can be accessed, but I can't even get it to run from the command line. Any ideas what's going on here?
The answer provided here also helps give more insight, but I am still running into my same error, Ffmpeg on idle python Mac