[vorbis-dev] ogg vorbis decoding

Michael Smith msmith at labyrinth.net.au
Sun Apr 29 06:39:35 PDT 2001

At 02:05 PM 4/29/01 +0200, you wrote:
>I am currently developing a ogg vorbis decoding module for use in
>winlame (a LAME frontend), and I have some questions:
>To do a decoder I used most code in decoder_example.c, but I think
>there is something missing. I would be glad if someone could look at

I don't really have time to look at your code right now (if you haven't
figured out a solution by tomorrow, I'll try to take a look then).
However, you should probably be using vorbisfile rather than directly
using libvorbis. This basically makes all the difficult bits get hidden,
and it's unlikely that you need access to the more complex parts. A 
decoder using vorbisfile shouldn't be more than a couple of dozen lines
(if that). See vorbisfile_example.c 

>Secondly, how can I find out the rough number of
>samples/pages/something else a ogg vorbis file has? I want to compute
>a percentage of the file done (for a progress meter) during decoding,
>so it needn't to be too accurate. Is this possible?

You find the final page of the logical stream, and look at the 
granulepos value for that page. If it's a single logical stream, this 
is pretty simple. For chained streams, it's relatively complex.
Vorbisfile does all this for both cases (as long as the file is seekable).


--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Vorbis-dev mailing list