Skip to content
Snippets Groups Projects
Commit df90af1e authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#936] Use 320 frame size

parent 6af380d8
Branches
Tags
No related merge requests found
......@@ -36,7 +36,7 @@ class Speex : public AudioCodec{
_preprocess_state()
{
_clockRate = 32000;
_frameSize = 320; // 20 ms at 32 kHz
_frameSize = 320; // 10 ms at 32 kHz
_channel = 1;
_bitrate = 0;
_bandwidth = 0;
......@@ -48,7 +48,7 @@ class Speex : public AudioCodec{
void initSpeex() {
int _samplingRate = 32000;
// int _samplingRate = 32000;
// 8000 HZ --> Narrow-band mode
// TODO Manage the other modes
......@@ -76,7 +76,7 @@ class Speex : public AudioCodec{
speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VAD, &enable);
speex_encoder_ctl(_speex_enc_state, SPEEX_SET_DTX, &enable);
speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality);
// speex_encoder_ctl(_speex_enc_state, SPEEX_SET_VBR_QUALITY, &quality);
speex_encoder_ctl(_speex_enc_state, SPEEX_SET_COMPLEXITY, &complex);
// Init the decoder struct
......@@ -132,7 +132,9 @@ class Speex : public AudioCodec{
#endif
printf("Codec::codecEncode() size: %i \n",size);
printf("Codec::codecEncode() _speex_frame_size %i\n", _speex_frame_size);
speex_encode_int(_speex_enc_state, src, &_speex_enc_bits);
int speex_nbByte = speex_bits_nbytes(&_speex_enc_bits);
int nbBytes = speex_bits_write(&_speex_enc_bits, (char*)dst, size);
printf("Codec::codecEncode() nbBytes: %i \n",nbBytes);
return nbBytes;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment