[vorbis-dev] Play time calculation

Karthik Murthy karthik.murthy at patni.com
Wed Oct 8 05:05:23 PDT 2003



Hi,

I do have a facility by which I can find out
the length of the ogg file. If the length of the
file is know how can the play time be computed..
Of course the play time should be computed
using just the length of the audio data and not the headers.
How can this be dome..

Cheers!
Karthik..

-----Original Message-----
From: owner-vorbis-dev at xiph.org [mailto:owner-vorbis-dev at xiph.org]On
Behalf Of Ralph Giles
Sent: Wednesday, October 08, 2003 5:28 PM
To: vorbis-dev at xiph.org
Subject: Re: [vorbis-dev] Play time calculation

<p>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.

--- >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