Dan Koretsky
Dan Koretsky

Reputation: 21

Python Audio Edit

I am searching for a way to write a simple python program to perform an automatic edit on an audio file.

I wrote with PIL automatic picture resizing to a predefined size. I would like to write the same for automatic file re-encoding into a predefined bitrate.

similarly, i would like to write a python program that can stretch an audio file and re-encode it.

do i have to parse MP3's by myself, or is there a library that can be used for this?

Upvotes: 2

Views: 11233

Answers (2)

astroboy
astroboy

Reputation: 1078

There is pydub. It's an easy to use library.

Upvotes: 0

Brad
Brad

Reputation: 163549

Rather than doing this natively in Python, I strongly recommend leaving the heavy lifting up to FFMPEG, by executing it from your script.

It can chop, encode, and decode just about anything you throw at it. You can find a list of common parameters here: http://howto-pages.org/ffmpeg/

This way, you can leave your Python program to figure out the logic of what you want to cut and where, and not spend a decade writing code to deal with all of the audio formats available.

If you don't like the idea of directly executing it, there is also a Python wrapper available for FFMPEG.

Upvotes: 3

Related Questions