Skip to content
Snippets Groups Projects
Commit 7156cbb3 authored by Alexandre Bourget's avatar Alexandre Bourget
Browse files

Try to set rate correctly.

+ Add .gitignore
parent a8002c48
Branches
Tags
No related merge requests found
# Ignore unused objects
*.lo
*.o
*.a
*.la
*.Po
*.Plo
# Ignore rendered docs
doc/html
# Ignore buildsys stuff
autom4te.cache
# Ignore temp portaudio stuff
tools/portaudio
# Ignore temp files
*~
...@@ -362,6 +362,7 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime) ...@@ -362,6 +362,7 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
SFLDataFormat* toAudioLayer; SFLDataFormat* toAudioLayer;
int nbSample = nbInt16; int nbSample = nbInt16;
// 48000 / 8000 = 6 .. Samplerate will convert to 48000 ?!
int nbSampleMaxRate = nbInt16 * 6; // TODO: change it int nbSampleMaxRate = nbInt16 * 6; // TODO: change it
if ( audiolayer->getSampleRate() != audiocodec->getClockRate() && nbSample) { if ( audiolayer->getSampleRate() != audiocodec->getClockRate() && nbSample) {
...@@ -374,7 +375,7 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime) ...@@ -374,7 +375,7 @@ AudioRtpRTX::receiveSessionForSpkr (int& countTime)
src_data.data_in = _floatBuffer8000; src_data.data_in = _floatBuffer8000;
src_data.data_out = _floatBuffer48000; src_data.data_out = _floatBuffer48000;
src_data.input_frames = nbSample; src_data.input_frames = nbSample;
src_data.output_frames = nbSampleMaxRate; src_data.output_frames = nbSample * audiolayer->getSample() / audiocodec->getClockRate();
src_data.src_ratio = factord; src_data.src_ratio = factord;
src_short_to_float_array(_receiveDataDecoded, _floatBuffer8000, nbSample); src_short_to_float_array(_receiveDataDecoded, _floatBuffer8000, nbSample);
src_simple (&src_data, SRC_SINC_BEST_QUALITY/*SRC_SINC_MEDIUM_QUALITY*/, 1); // 1=mono channel src_simple (&src_data, SRC_SINC_BEST_QUALITY/*SRC_SINC_MEDIUM_QUALITY*/, 1); // 1=mono channel
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment