[ogg-dev] Problems seeking with liboggz

Milutin Jovanović
Thu, 17 May 2012 14:04:29 -0000

I'm no expert, but it sounds to me like normal variable bitrate stream
behaviour. With variable bit rate, you cannot calculate exact byte address
from time reference. So, in general you estimate and get close to time
reference requested. Whenever you need precise pocision, you should use
constant bit rate or a byte offset (instead of time/milliseconds).

FYI, in my apps, I use time to show progres to the user, but when I save a
bookmark or pause, I record exact sample offset, and restart from there.
So, time for UI, samples/bytes for hidden/underlying code.

Miki.



On 16 May 2012 18:52, Julio Cesar Esteves Cabezas <jcabezas at
inovax.com.br>wrote:

> Hi,****
>
> ** **
>
>   I intend to use Ogg+Speex for voice recording/playback in a VoIP app.***
> *
>
>   I am experimenting with liboggz to get acquainted with its API. ****
>
>   As test files I am using some Ogg-Speex files converted from WAV files
> with speexenc.exe.****
>
>   ****
>
>   I wrote a little testing app in Visual Studio 2010 under Windows 7. ****
>
>   I defined OggzReadPage and OggzReadPacket callbacks with
> oggz_set_read_page() and oggz_set_read_callback().****
>
>   ****
>
>   For the moment I am mainly having troubles with seeking. Maybe I am not
> using correctly liboggz API.****
>
>   What happens:****
>
>   - I open a Ogg Speex-encoded audio file with
oggz_open("MyFile.spx",
> OGGZ_READ | OGGZ_AUTO); ****
>
>   - I have a loop of invocations of oggz_read() that triggers in the due
> time the page and packet callbacks defined by me.****
>
>   - But when I randomly do seeking by means of  ****
>
>       ogg_int64_t rseek = oggz_seek_units(pOGGZ, posMsecs, SEEK_SET);****
>
>     I get erratic results: ****
>
>       Many times rseek does not match posMsecs.      ****
>
>       The first page callback after the seek invocation refers to a page
> that is sometimes previous and sometimes after the page that contains
> posMsecs.****
>
>       ****
>
> ** **
>
>   What rules are to be followed for seeking with liboggz and what exact
> results can be expected from it ?****
>
> ** **
>
> ** **
>
> Thanks in advance****
>
> Julio Cabezas****
>
> ** **
>
> ** **
>
> _______________________________________________
> ogg-dev mailing list
> ogg-dev at xiph.org
> http://lists.xiph.org/mailman/listinfo/ogg-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...