<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'>Hi,<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> I intend to use Ogg+Speex for voice recording/playback in a VoIP app.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> I am experimenting with liboggz to get acquainted with its API. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> As test files I am using some Ogg-Speex files converted from WAV files with speexenc.exe.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> I wrote a little testing app in Visual Studio 2010 under Windows 7. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> I defined OggzReadPage and OggzReadPacket callbacks with oggz_set_read_page() and oggz_set_read_callback().<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> For the moment I am mainly having troubles with seeking. Maybe I am not using correctly liboggz API.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> What happens:<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> - I open a Ogg Speex-encoded audio file with oggz_open("MyFile.spx", OGGZ_READ | OGGZ_AUTO); <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> - I have a loop of invocations of oggz_read() that triggers in the due time the page and packet callbacks defined by me.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> - But when I randomly do seeking by means of <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> ogg_int64_t rseek = oggz_seek_units(pOGGZ, posMsecs, SEEK_SET);<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> I get erratic results: <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> Many times rseek does not match posMsecs. <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> The first page callback after the seek invocation refers to a page that is sometimes previous and sometimes after the page that contains posMsecs.<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> <o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'> What rules are to be followed for seeking with liboggz and what exact results can be expected from it ?<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'>Thanks in advance<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-family:Consolas'>Julio Cabezas<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>