Reputation: 247
So here is my code :
from pydub import AudioSegment
sound1 = AudioSegment.from_mp3("sound_0.mp3")
sound2 = AudioSegment.from_mp3("sound_1.mp3")
sound = sound1 + sound2
sound.export("test.mp3",format="mp3")
Problem : I got the error message : WindowsError: [Error 2] The system can not find the file specified
System configuration Python version: 3.8 Pydub version: I just installed it ffmpeg or avlib?: ffmpeg ffmpeg/avlib version: 2020-12-15-git-32586a42da-full_build-www.gyan.dev
What did I try ? So, I found some things to do on a Stackoverflow subject, I tried to add this
pydub.AudioSegment.ffmpeg = "way//to//ffmpeg.exe"
But it doesn't worked, then this
AudioSegment.converter = "way//to//ffmpeg.exe"
Still doesn't work, so, because I'm on spyder with anaconda, I tried this on the anaconda prompt
conda install -c conda-forge ffmpeg
I even tried to put ffmpeg.exe,ffplay.exe in the current working directory but still doesn't worked..
So I'm desperately here for some help, thanks in advance
Upvotes: 1
Views: 1344
Reputation: 21
I was able to fix this same issue by putting ffprobe.exe
in the current working directory, or replacing a function within pydub's utils by using monkey patching with pydub.utils.get_prober_name = lambda: 'path/to/ffprobe.exe'
but that may not work for you
Upvotes: 2