[Vorbis] Using decoding vorebis from a Vorbis / Theora Video

Charles Mason charlie.mas at gmail.com
Mon Feb 19 15:05:59 PST 2007


Thanks for the info Ralph. I have managed to implement what I think is
the correct Vorbis decoding routine. I am now getting the pointer back
from pcm out.

My problem now is obtaining the PCM data. To simplify things I decided
to try and dump the raw PCM data out to a file then use Audacity to
play it back using its Raw import function. That way I can leave the
playing of the audio until I know I have the decoding working. I have
had a few problems with this approach, is this a sound way of testing
the decoded data or I have misunderstood something about the output.

I was wondering if someone could clarify what format and size the PCM
data is in. It appears to be a pointer to a 2 dimensional float array.
I assume one dimension is the channel number and the is the time
offset of the sample.

Because C# is a manage memory envirmoment I can't simply manipulate
the pointers like you can in C (its sort of possible but its a bit
different). I can read the data in to a 1 dimensional float array
starting from the pointer, received fairly simply and efficiently. How
is the data packed in libvorbis, is it channel first or time offset
first.

How long is the data. I get the sample number returned from the pcmout
function. Is that per channel. So if its stereo and I get 576 returned
I need to read in 576 * 2 floats.

As there's little documentation a little bit of clarification would be
a great help.

Charlie


More information about the Vorbis mailing list