MP3 wave graph

Hello

I’m looking for a way to display a MP3 file’s wave. It’s for an audio lessons player, so the main purpose is allowing the user to see where are the sounds and pauses, so he / she can fast forward to the next chapter or rewind to the past one. Something along the lines of Audacity’s waveform (example: http://www.icsi.berkeley.edu/Speech/mr/images/headset_waveform.gif).

I have found few libraries / packages capable of producing it, most of them are abandoned or for Tkinter. One of them (attached) is working quite well, but only over .wav files and the conversion between MP3 -> wav takes too long.

Question: is there any package / library / function that can successfully extract an waveform-like graph from an MP3 file? It doesn’t have to create an image file, like the given example, just the graph points are enough.

wav2png.py (16.8 KB)

Lucas Boppre Niehues wrote:

Hello

I'm looking for a way to display a MP3 file's wave. It's for an audio lessons player, so the main purpose is allowing the user to see where are the sounds and pauses, so he / she can fast forward to the next chapter or rewind to the past one. Something along the lines of Audacity's waveform (example: http://www.icsi.berkeley.edu/Speech/mr/images/headset_waveform.gif).

I have found few libraries / packages capable of producing it, most of them are abandoned or for Tkinter. One of them (attached) is working quite well, but only over .wav files and the conversion between MP3 -> wav takes too long.

Question: is there any package / library / function that can successfully extract an waveform-like graph from an MP3 file? It doesn't have to create an image file, like the given example, just the graph points are enough.

Not that I'm aware of. Did you look at PyMedia at all? Depending on what those Tk ones do, you may be able to just re-implement them in wxPython...

Mike

Lucas Boppre Niehues wrote:

I'm looking for a way to display a MP3 file's wave. It's for an audio
lessons player, so the main purpose is allowing the user to see where
are the sounds and pauses, so he / she can fast forward to the next
chapter or rewind to the past one. Something along the lines of
Audacity's waveform (example:
http://www.icsi.berkeley.edu/Speech/mr/images/headset_waveform.gif).

I have found few libraries / packages capable of producing it, most of
them are abandoned or for Tkinter. One of them (attached) is working
quite well, but only over .wav files and the conversion between MP3 ->
wav takes too long.

I think you may need to alter your expectations a bit. An MP3 file does
not have a wave. It's merely the compressed representation of a wave.
The only way to get a waveform from an MP3 is to decompress it, and that
is exactly what Audacity is doing. There is simply no alternative.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.