[Speex-dev] Speex seek with high precision
arnau.alemany at gmail.com
Wed May 13 13:18:51 PDT 2009
I'm new to this mailing list so I'm sorry if it's the wrong place to post
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.
I've also used ogg_page_granulepos for seeking but it seems more difficult
to use. I use something like this:
while (ogg_sync_pageout(&oy, &og) != 1)
data = ogg_sync_buffer(&oy, 512);
readbytes = fread(data, 1, 512, spxfile);
//printf("ogg_page_granulepos: %lld\n", ogg_page_granulepos(&og));
while (ogg_page_granulepos(&og) < time * freq); // time in seconds,
But this way I can't get enough precision neither.
Could anyone give me some idea of what could I do to get a high precision
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Speex-dev