SpeexBits bits; void *dec_state; int bufferPosition = 0; const int SAMPLES_PER_SEC = 32000; const int BUFFER_LEN_SECONDS = 5; const int FRAME_SIZE_BYTES = SAMPLES_PER_SEC / (1000 / 20) * sizeof(int16_t); QByteArray outBuf; outBuf.resize(SAMPLES_PER_SEC * sizeof(int16_t) * BUFFER_LEN_SECONDS); ... QByteArray inBuf((const char*)msg->payload, msg->size); speex_bits_read_from(&bits, inBuf.data(), inBuf.size()); speex_decode_int(dec_state, &bits, outBuf.data() + bufferPosition); bufferPosition += FRAME_SIZE_BYTES; ... <playback>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)