I wrote an opus test program to encode and decode the record data at a sequence like that:<div><br></div><div>......record something to data(variable)...............</div><div><br></div><div><div> for ( i=0; i<data.maxFrameIndex; i+=480)</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>encoded = opus_encode(en,&data.recordedSamples[i],480,buf,4096);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>printf("encoded:%d\n",encoded);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>decoded = opus_decode(de,buf,encoded,&data2.recordedSamples[i],480,0);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>printf("decoded:%d\n",decoded);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>data2.maxFrameIndex += decoded;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div></div><div><br></div><div>........play the decoded samples in data2(variable)..................</div>
<div><br></div><div>I can hear my voice, but just the first part of it,and the last is mising, while it works well without the codec progress,</div><div>i'm confused and had no idea,anyone can give me some advice please, Thanks a lot!</div>
<div><br></div>