[Vorbis-dev] Determining the duration of an ogg vorbis file
Mathias Kunter
mathiaskunter at yahoo.de
Tue Mar 18 04:03:01 PDT 2008
Hi all,
I've got a question on regarding how to find out the duration of an ogg vorbis file. Sorry if it should already be mentioned somewhere in the docs, but I couldn't find out how to do it the best way.
So, I can read the [bitrate_nominal] field from the identification header (if it is set), find out the size of the audio data (by subtracting the size of the three headers from the length of the file stream), and get the duration of the file with duration = audio size / nominal bitrate.
However, is this the right way to go? What can I do if the nominal bitrate is unset in the identification header?
Any help is highly appreciated.
Thank you very much,
Mathias K.
Lesen Sie Ihre E-Mails jetzt einfach von unterwegs.
www.yahoo.de/go
More information about the Vorbis-dev
mailing list