I\'m trying to find a Python library that would take an audio file (e.g. .ogg, .wav) and convert it into mp3 for playback on a webpage.
Also, any thoughts on settin
I wrote a library designed to do that =D
from pydub import AudioSegment
AudioSegment.from_file("/input/file").export("/output/file", format="mp3")
Easy!
to specify a bitrate, just use the bitrate kwarg…
from pydub import AudioSegment
sound = AudioSegment.from_file("/input/file")
sound.export("/output/file", format="mp3", bitrate="128k")