<div dir="ltr"><div class="gmail_quote"><span class="Apple-style-span" style="font-weight: bold;">Caveat</span>: Take what I'm saying with a grain of salt -- I haven't actually written any code that decodes speex frames myself, though I have written code using Jean-Marc's Speexdsp lib.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Comments below inline</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Thu, Oct 9, 2008 at 9:28 AM, Darren Longhorn <span dir="ltr"><<a href="mailto:darren.longhorn@redembedded.com">darren.longhorn@redembedded.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">I think I still didn't fully understand. As a test I encoded some frames<br></div>
(wideband, with quality set to 8), each were 70 bytes. I then did three<br>
things:<br>
<br>
- passed half of it to the decoder<br>
- passed exactly one frame to the decoder<br>
- I passed two concatenated frames to the decoder.<br>
<br>
In all cases speex_decode_int returned 0.<br>
<br>
Unless I misunderstood what you say above, I think it should have<br>
returned 0 only for the third test, -1 for the second test and perhaps<br>
-2 for the first test?</blockquote><div><br></div><div>From what I can tell, here is what happens, and why (I think) you're receiving 0 for all three tests:</div><div><ol><li>You pass in half the samples as the 'bits' arg. Speex looks at 1 frame worth of those bits and decodes them, decoded result in 'pcm'.</li>
<li>You pass in exactly 1 frame of data as the 'bits' arg. Speex looks at 1 frame worth of those bits (which is all there, exactly), decodes them, stores decoded result in 'pcm'.</li><li>You pass in 2 frames of data as the 'bits' arg. Speex looks at 1 frame worth of those bits (which, again, is all there), decodes them, stores decoded result in 'pcm'.</li>
</ol><div>When there is no more data to decode, then speex will return -1. I'm also thinking that you'd need to somehow change what 'bits' points to (advancing the pointer to the next frame)... Or then again, I could be entirely wrong here -- I haven't actually written any speex_decode_int code myself (though I have maintained it, and the speex linkages for the project I've worked on). </div>
</div></div><br>-- <br>Keith Kyzivat<br><br>SIPez LLC.<br>SIP VoIP, IM and Presence Consulting<br><a href="http://www.SIPez.com">http://www.SIPez.com</a><br>tel: +1 (617) 273-4000<br>
</div>