[Speex-dev] notification: More than two wideband layers found. The stream is corrupted.
Vijay Gabale
vijay.gabale at gmail.com
Sat Jul 24 21:18:59 PDT 2010
Dear Speex Devs,
One more problem from my side. I had earlier queried about bad quality of
speex.
For this run, I changed the memory mode option in CCStudio to none from
large. (I will explain this if required.)
Now, I am trying to run speex on C55x in real time.
Find a code snippet from my main function below.
Basically, I am getting the error mentioned in the subject line.
Weird thing is that, for the statements marked in bold below, if I enable
printf, I don't get this error, whereas if I disable it, Speex complains
with this error.
Is it because of the delay required?
By having a look at the code, and the code structure which I have mentioned
in the code itself, can you throw some insight?
Also why should this error occur at first place? I searched the forum but
could not find the exact solution.
Awaiting reply.
Vijay
if(canEncode == 1) //sets to 1 when DMA is ready with 20ms
samples with 8khz sampling
{
canEncode = 0;
if(busyEncoding == 0) // to guard encoding and decoding
{
busyEncoding = 1;
//copy 20ms data (160 is the frame size) to encode
for(i_loop = 0; i_loop < FRAME_SIZE; i_loop++)
{
if(CurrentRxR_DMAChannel == 2)
{
inout_byte[2*i_loop] = RcvL1[i_loop];
inout_byte[2*i_loop+1] = RcvR1[i_loop];
}
else
{
inout_byte[2*i_loop] = RcvL2[i_loop];
inout_byte[2*i_loop+1] = RcvR2[i_loop];
}
}
byte2word(inout_byte, in_short, FRAME_SIZE);
speex_bits_reset(&bits);
returnVal = speex_encode_int(encoderState, (spx_int16_t
*) in_short, &bits);
nbChars = speex_bits_write(&bits, cbits,
sizeof(cbits)*BYTES_PER_CHAR) /BYTES_PER_CHAR;
speex_bits_rewind(&bits);
speex_bits_read_from(&bits, cbits,
TESTENC_BYTES_PER_FRAME);
* //printf("%d\n",counterDecode++);
counterDecode++; *
returnVal = speex_decode_int(decoderState, &bits,
(spx_int16_t *)out_short);
if(returnVal != 0)
{
printf("speex decode int falied %d %d", returnVal,
counterDecode);
exit(0);
}
speex_bits_reset(&bits);
skip_group_delay = 0;
busyEncoding = 0;
//printf("encode-decode complete\n");
//copy decode data to playback through DMA
for(i_loop = 0; i_loop < FRAME_SIZE; i_loop++)
{
if(CurrentTxR_DMAChannel == 1)
{
XmitL1[i_loop] = out_short[2*i_loop];
}
else
{
XmitL2[i_loop] = out_short[2*i_loop];
}
}
for(i_loop = 0; i_loop < FRAME_SIZE; i_loop++)
{
if(CurrentTxR_DMAChannel == 1)
{
XmitR1[i_loop] = out_short[2*i_loop + 1];
}
else
{
XmitR2[i_loop] = out_short[2*i_loop + 1];
}
}
busyEncoding = 0;
}
else
{
//printf("encoder called when busy\n");
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/speex-dev/attachments/20100725/6293f47d/attachment.htm
More information about the Speex-dev
mailing list