itay12v
itay12v

Reputation: 1

Can't change audio file format - python

I'm creating a program for school that streams video and audio from youtube and displays them for a few clients at the same time. For this, I need to change a file's format to .mp3 and I learned that I can do that with pydub AudioSegment, yet, I keep getting an error.

That's the code lines that bring the error:

original_audio = AudioSegment.from_file(original_name)
original_audio.export(new_name, format="mp3")

This is the error:

WindowsError: [Error 2] The system cannot find the file specified

Thank you in advance.

Upvotes: 0

Views: 150

Answers (1)

Sasha
Sasha

Reputation: 1724

Do you have ffmpeg installed? AFAIK that is a requirement. You can download ffmpeg from here: http://ffmpeg.org

Put this in your script directory and everything should then work fine.

Upvotes: 1

Related Questions