Skip to main content

Topic: Extracting frequency data from Ogg Vorbis (Read 4266 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • eddyb
  • [*]
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

  • saratoga
  • [*][*][*][*][*]
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.