pydub icon indicating copy to clipboard operation
pydub copied to clipboard

AudioSegment.from_mp3() raises FileNotFoundError

Open AlkisPis opened this issue 1 year ago • 9 comments

Steps to reproduce

Expected behavior

Tell us what should happen song = pydub.AudioSegment.from_mp3(MP3file) should return a 'pydub.audio_segment.AudioSegment object'

Actual behavior

Tell us what happens instead It raises "FileNotFoundError: [WinError 2] The system cannot find the file specified", although the 'MP3file' is verified to exist.

Your System configuration

  • Python version: 3.7
  • Pydub version: 0.25.1
  • ffmpeg or avlib?: ffmpeg
  • ffmpeg/avlib version: N-93230-gfc32e08941

Is there an audio file you can include to help us reproduce?

You can include the audio file in this issue - just put it in a zip file and drag/drop the zip file into the github issue. audio.zip

AlkisPis avatar Jul 10 '23 15:07 AlkisPis

Hi, I have the same issue. Have you found any solution?

ahmad-alismail avatar Jul 12 '23 08:07 ahmad-alismail

Same here.

szetakyu avatar Jul 12 '23 10:07 szetakyu

Adding the the folder of the installed 'ffmpeg' S/W to the environment PATH (in Windows) solves the problem.

Which means that the FileNotFound error does not refer to the MP3 file but rather to some component of the 'ffmpeg' S/W (ffmpeg.exe or ffprobe.exe), which the developer thought unnecessary to name. Well, this is the result of slipshod programming: it produces unnecessary traffic annd trouble.

AlkisPis avatar Jul 12 '23 11:07 AlkisPis

Hi, I have the same issue. Have you found any solution?

See the answer I just posted ...

AlkisPis avatar Jul 12 '23 11:07 AlkisPis

Adding the the folder of the installed 'ffmpeg' S/W to the environment PATH (in Windows) solves the problem.

Which means that the FileNotFound error does not refer to the MP3 file but rather to some component of the 'ffmpeg' S/W (ffmpeg.exe or ffprobe.exe), which the developer thought unnecessary to name. Well, this is the result of slipshod programming: it produces unnecessary traffic annd trouble.

How to fix it in MacOS?

fau1095 avatar Aug 07 '23 07:08 fau1095

Thanks @fau1095. I have already indicated this solution about a month ago.

AlkisPis avatar Aug 07 '23 10:08 AlkisPis

Thanks @fau1095. I have already indicated this solution about a month ago.

Your solution only includes Windows systems, what about Mac OS? Anyways I found a better option for this purpose so I'm not using pydub anymore

fau1095 avatar Aug 07 '23 17:08 fau1095

Adding the the folder of the installed 'ffmpeg' S/W to the environment PATH (in Windows) solves the problem.

Which means that the FileNotFound error does not refer to the MP3 file but rather to some component of the 'ffmpeg' S/W (ffmpeg.exe or ffprobe.exe), which the developer thought unnecessary to name. Well, this is the result of slipshod programming: it produces unnecessary traffic annd trouble.

Thank you @AlkisPis for the solution. It works for me in windows.

mausam-office avatar Oct 02 '23 12:10 mausam-office

You're welcome, @mausam-office. Glad it worked for you too.

AlkisPis avatar Oct 03 '23 05:10 AlkisPis