[opus] Moving from Speex to Opus (question 2)
hermie.weber at gmx.de
Thu May 9 11:30:33 PDT 2013
I was using Speex all the time, and I am now moving to Opus.
I had encapsulated the decoder a bit, I had the following cpp file:
#define MAX_FRAME_SIZE 2000
#define MAX_FRAME_BYTES 2000
CSpxCodec::CSpxCodec() : enh(1), rate(8000)
decstate = speex_decoder_init(&speex_nb_mode);
speex_decoder_ctl(decstate, SPEEX_SET_SAMPLING_RATE, &rate);
speex_decoder_ctl(decstate, SPEEX_SET_ENH, &enh);
speex_decoder_ctl(decstate, SPEEX_GET_FRAME_SIZE, &iFrameSize);
void CSpxCodec::Decode(unsigned char* inbuf, short* outbuf, unsigned int
unsigned int i=0;
unsigned int j=0;
for (i=0; i<(len/62); i++)
cbits[j] = inbuf[(i*62)+j];
speex_bits_read_from(&bits, cbits, 62);
speex_decode(decstate, &bits, output);
outbuf[j+(i*160)] = output[j];
I would like to ask if I can keep this "wrapper".
Please anybody tell me that I can just replace the word "speex" with
"opus", and it will work, hehehehehe!
Can I keep the 62, 160 part, or will that be different in Opus?
I am not asking because I am lazy, I am just scared because Opus look so
much different than Speex, and there is no "encoding/decoding for
dummies" example as there was in Speex.
Could anybody perhaps give me another push in the right direction and
tell me how a good starting point for Opus newbies?
Thank you so much.
More information about the opus