Hello everybody, <br>I'm new to this mailing list so I'm sorry if it's the wrong place to post this. <br><br>I'm developing a Speex player and I need to seek with a precision of milliseconds. I used liboggz that supposedly does just that, but it never seeks exactly where it should. For example if I use oggz_seek_units(oggz, 18450, SEEK_SET) result it's 16386 and there is a delay between the playback and the moment where it should start. Only when I seek to position 0 I get the desired result. <br>
<br>I've also used ogg_page_granulepos for seeking but it seems more difficult to use. I use something like this: <br> <br> do<br> { <br> while (ogg_sync_pageout(&oy, &og) != 1)<br> {<br>
data = ogg_sync_buffer(&oy, 512);<br> readbytes = fread(data, 1, 512, spxfile);<br> ogg_sync_wrote(&oy, readbytes);<br> } <br> //printf("ogg_page_granulepos: %lld\n", ogg_page_granulepos(&og));<br>
} <br> while (ogg_page_granulepos(&og) < time * freq); // time in seconds, freq: 16000<br><br>But this way I can't get enough precision neither. <br><br>Could anyone give me some idea of what could I do to get a high precision when seeking? <br>
<br>Thank you, <br>Arnau <br clear="all"><br><br>