0

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

Madar
  • 196
  • 2
  • 15
  • 2
    always put full error message (starting at word "Traceback") in question (notcomment) as text (not screenshot).There are othr useful information. – furas Dec 19 '20 at 23:19
  • 2
    you didn't show full error message so it is not clear if you have problem with `.exe` files or with `.mp3` files. Maybe all your problem is `/full/path/to/sound_0.mp3` – furas Dec 19 '20 at 23:20
  • 1
    if you think it is problem with `ffmpeg.exe` then you should open `cmd.exe` and check if works `C:/full/path/to/ffmpeg.exe` – furas Dec 19 '20 at 23:23
  • This answer might be useful for you too. https://stackoverflow.com/a/76906056/15863196 – Masoud Gheisari Aug 15 '23 at 12:55

1 Answers1

2

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

Charnuz
  • 21
  • 1
  • 3