[ogg-dev] Could any one suggest me in how to get the duration of an Ogg File

Conrad Parker conrad at metadecks.org
Fri Sep 30 07:09:28 PDT 2005


On Fri, Sep 30, 2005 at 10:41:02AM +0100, rajeev nair wrote:
> Could any one suggest me in how to get the duration of an OggVorbis File.I am
> really caught up in this, as it seems to be complicates as the OggVorbis is a
> variable bit rate.

First, seek to the end of the file and read the granulepos of the last
Ogg page. That tells you the index in samples of the end of it (the
last chain).

...

Conrad.


More information about the ogg-dev mailing list