<div dir="ltr"><div><div>Hello All<br><br></div><div>I have successfully run the Opus Decoder for 16-bit WAV files. However when doing the same on 8-bit, the decoder produces noise, but on 16 bit data the output is working. Both the 8 and 16 bit files are from the same source and hence except for some loss of quality on 8 bit, they are identical in total play back duration.<br><br></div><div>For both 8 and 16 bit data I have used the following parameters<br><br>ui32SamplingRate = 8000<br></div><div>ui32Channel = 1<br>FRAME_SIZE_IN_MS is 20<br></div><div>MAX_PACKET is 1500<br></div><div><br></div><div>ui8ScaleFactor = 1 for 8-bit and 2 for 16-bit data<br>ui32BitsPerSample = 8 for 8-bit data and 16 for 16-bit data<br><br>The code is as follows<br><br>sOpusDec = opus_decoder_create(ui32SamplingRate, ui32Channel, &amp;i32error);<br>if (i32error != OPUS_OK)<br>{<br>       return((int)i32error);<br>}<br><br>opus_decoder_ctl(sOpusDec, OPUS_SET_LSB_DEPTH(ui32BitsPerSample));<br><br>ui32SizeOfWrBuf = (ui32SamplingRate*ui32Channel*FRAME_SIZE_IN_MS*ui8ScaleFactor)/1000;<br>opi16_out = (int16_t*)calloc(((ui32SizeOfWrBuf/ui8ScaleFactor)+1),sizeof(int16_t));<br>pcRdBuf = (uint8_t *)calloc(MAX_PACKET,sizeof(uint8_t));<br><br>output_samples = opus_decode(sOpusDec, (const unsigned char *)&amp;pcRdBuf[0], len, opi16_out, (ui32SizeOfWrBuf/ui8ScaleFactor), 0);<br><br></div><div></div><div>I am not able to understand what the issue is. Or do I need to look at the encoder?<br></div><div><br></div>Regards<br></div>Amit<br></div>