Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Extracting frequency data from Ogg Vorbis (Read 6295 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Extracting frequency data from Ogg Vorbis

Hi,

I'd like to extract frequency data along with PCM data from an OggVorbis stream. (Think: displaying an equalizer during audio playback.) I figure this would be much cleaner (and faster) than running a discrete fourier transform on the PCM data after the fact.

I'm a fairly high level user of libogg and libvorbis (using libvorbisfile for now), but I've poked around a bit in the code, and I suspect the data I'm looking for is in the pcm array that enters mdct_backward(). Is that correct? I'd really appreciate some pointers on where in the decoding pipeline to get at this data, and what format it's in. For instance, how is the magnitude vs. phase laid out in memory per frequency?

Many thanks!
Eddy

Extracting frequency data from Ogg Vorbis

Reply #1
I'm a fairly high level user of libogg and libvorbis (using libvorbisfile for now), but I've poked around a bit in the code, and I suspect the data I'm looking for is in the pcm array that enters mdct_backward(). Is that correct?


Thats going to give you the MDCT domain data, which is about as close to an DFT as you're going to find in Vorbis.  I'm not really sure if theres an easy way to get something that'd look right for your visualization.