[ogg-dev] Finding out the duration of an Ogg stream

Jon Kristensen info at jonkri.org
Fri Jun 6 13:21:57 PDT 2008


Hello people!

I'm developing a Java Ogg media player applet and I have encountered a 
problem while creating a progress bar. I need to know how long, in 
samples or seconds, the Ogg stream that I'm playing is, and I need to 
know it before I have downloaded the entire stream. Problem is, I don't 
see how I could do that.

I could provide a "duration" argument, but that would make using my 
player quite messy, as the web masters would have to use a script to 
check the numbers of samples everytime they want to add an Ogg file.

Do you know a way that I could get around this somehow? Maybe some 
header data that I have missed?

If not, what is the easiest way to check the numbers of samples?

Thank you so much in advance!

Sincerely,
Jon Kristensen


More information about the ogg-dev mailing list