[vorbis-dev] "wrong" total time from ov_time_total

Rodrigo Gómez rgomez at msa.com.mx
Thu Sep 11 15:31:55 PDT 2003



Hello there.

I'm finding that ov_time_total doesn't return the "expected" value for some
files I'm encoding. How do I know that? Well... in the encoder, when I push
the "record" button I store the time when I did it, and when I push the stop
button I store also that time. I would expect that the time returned by
ov_time_total would be some ms less than finish_time - start_time, but, in
some cases, it is up to 5 minutes less. The strange thing: It doesn't seem
to loose data. I mean, I can hear to the audio and hear that everything that
it's supposed to be it's there, but the time says different.

So, it's ov_time_total accurate? I'm having some other more serious
problems, as I store events that are time related, and I need to seek to
that specific times.

What I have done to "solve" this problem is get a "time factor"
(expected_time/ov_time_total) and apply it to seek and so on, but I'm not
happy with this, as I would like to know the cause, and not only solve an
effect of the problem.

This problems seems to be more present when saving non 44.1 Khz audio, for
example, 8,820 Hz or so. I haven't tryed with sample rates above 44,100 Hz.
Does something special has to be used to record audio at different sample
rates? I'm correctly passing the sample rate and the number of channels to
the encoder.

I'm using ov_time_total like this:
    total_length = ov_time_total(&oggvorbis_file, -1);

Thanks, and regards

Rodrigo Gómez

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