[vorbis-dev] Play time calculation

Ralph Giles giles at xiph.org
Wed Oct 8 04:58:15 PDT 2003



On Wed, Oct 08, 2003 at 05:22:35PM +0530, Karthik Murthy wrote:

> How can I compute the play time of an ogg file 
> when the file is not seekable i.e. I am not able to use 
> the ov_time_total() function as the file is not seekable.
> Can someone tell me solution to this problem.

There is no way to comput the play time of an unseekable file. If you 
can't seek to the end you don't know how long it is. This is by design 
as part of the bitstream (as opposed to file) orientation of Ogg.

So, buffer the file until it's done? If it's a static file on the other 
end, you can estimate from the size (e.g. from http headers) and average 
bitrate, or otherwise pass it as metadata.

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