[Vorbis] Howto get playtime

John Morton jwm at angrymonkey.net.nz
Thu May 4 08:59:03 PDT 2006

On Friday 05 May 2006 01:29, Thomas Kuglitsch wrote:
>  Hi,
>  Searched in Google, browsed xiph vorbis sites but found no good
> information about how to get the current playtime out of the
> granuleposition of the ogg_packet.

What granule position means depends on the codec being encapsulated.

From http://www.xiph.org/vorbis/doc/Vorbis_I_spec.html, section A 2:

#  The granule position of pages containing Vorbis audio is in units of PCM 
audio samples (per channel; a stereo stream's granule position does not 
increment at twice the speed of a mono stream). 

There's more, however, so give those docs a read.

>  Anyone knows if there is any 'Programming with libvorbis' documentation
> out there, cause on xiph's site (http://www.xiph.org/vorbis/doc/) there's
> nothing :(

Nothing that I'm aware off. Most people can get away with using libvorbisfile.


More information about the Vorbis mailing list