[vorbis] retrieving "instant" bitrate without vo_open?

safemode safemode at speakeasy.net
Sat Sep 22 21:29:22 PDT 2001



On Saturday 22 September 2001 23:41, Michael Smith wrote:
> >How could i do that without vorbisfile?  none of the other structures have
> > a bitrate element.  That's the problem i'm having.
>
> Ah... Now I see. Ok, vorbisfile is totally useless for this (well, not
> totally. One COULD make it work. But it's not suitable).
>
> You want to use mostly libogg, plus two or three functions from libvorbis.
> You need to read in each packet in order (see the ogg docs or maybe
> decoder_example.c for how to do this). Then, instead of actually decoding
> the packet, use vorbis_packet_blocksize() to get the size (in samples) of
> the packet (see vcut or vorbiscomment for an example of how to use these).

Is none of this documented on the xiph site?  i cant find anythnig but ov 
functions and some structures.  ?  

i'm reading through the headers now but what type is packet?  ogg_packet has 
bytes and ogg_page has body_len .   

> Then, you have the length in samples of the packet, and the length in bytes
> of the packet (packet->length) - to get bitrate, you just need the
> samplerate of the file. To get this, submit the three header packets (at
> the start of the stream) to vorbis_synthesis_headerin() (again, see
> decoder_example). Then vi->rate is the sample rate.
>
> Michael
>
>
> --- >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-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.

--- >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-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 mailing list