<br>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).<br>
<br>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.<br><br clear="all">
Miki.<br><br>
<br><br><div class="gmail_quote">On 16 May 2012 18:52, Julio Cesar Esteves Cabezas <span dir="ltr"><<a href="mailto:jcabezas@inovax.com.br" target="_blank">jcabezas@inovax.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="PT-BR"><div><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US">Hi,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> I intend to use Ogg+Speex for voice recording/playback in a VoIP app.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> I am experimenting with liboggz to get acquainted with its API. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> As test files I am using some Ogg-Speex files converted from WAV files with speexenc.exe.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> I wrote a little testing app in Visual Studio 2010 under Windows 7. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> I defined OggzReadPage and OggzReadPacket callbacks with oggz_set_read_page() and oggz_set_read_callback().<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> For the moment I am mainly having troubles with seeking. Maybe I am not using correctly liboggz API.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> What happens:<u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> - I open a Ogg Speex-encoded audio file with oggz_open("MyFile.spx", OGGZ_READ | OGGZ_AUTO); <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> - I have a loop of invocations of oggz_read() that triggers in the due time the page and packet callbacks defined by me.<u></u><u></u></span></p><p class="MsoNormal">
<span style="font-family:Consolas" lang="EN-US"> - But when I randomly do seeking by means of <u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> ogg_int64_t rseek = oggz_seek_units(pOGGZ, posMsecs, SEEK_SET);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> I get erratic results: <u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> Many times rseek does not match posMsecs. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> The first page callback after the seek invocation refers to a page that is sometimes previous and sometimes after the page that contains posMsecs.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> <u></u><u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"> What rules are to be followed for seeking with liboggz and what exact results can be expected from it ?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US">Thanks in advance<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></span></p>
<span class="HOEnZb"><font color="#888888"><p class="MsoNormal"><span style="font-family:Consolas" lang="EN-US">Julio Cabezas<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p><p class="MsoNormal">
<span lang="EN-US"><u></u> <u></u></span></p></font></span></div></div><br>_______________________________________________<br>
ogg-dev mailing list<br>
<a href="mailto:ogg-dev@xiph.org">ogg-dev@xiph.org</a><br>
<a href="http://lists.xiph.org/mailman/listinfo/ogg-dev" target="_blank">http://lists.xiph.org/mailman/listinfo/ogg-dev</a><br>
<br></blockquote></div><br>