Commit a7bed668 authored by Alexandre Savard's avatar Alexandre Savard

[#2209] Fix recording in regard of resamling

parent 6a14e843
......@@ -497,6 +497,8 @@ namespace sfl {
throw AudioRtpSessionException();
}
_ca->setRecordingSmplRate(_audiocodec->getClockRate());
_audiolayer->startStream();
static_cast<D*>(this)->startRunning();
......@@ -518,7 +520,7 @@ namespace sfl {
// Let's wait for the next transmit cycle
if (sessionWaiting == 1) {
// Record mic and speaker during conversation
_ca->recAudio.recData (_spkrDataConverted, _micData, _nSamplesSpkr, _nSamplesMic);
_ca->recAudio.recData (_spkrDataDecoded, _micData, _nSamplesSpkr, _nSamplesMic);
} else {
// Record mic only while leaving a message
_ca->recAudio.recData (_micData,_nSamplesMic);
......
......@@ -25,7 +25,7 @@ Recordable::Recordable()
FILE_TYPE fileType = FILE_WAV;
SOUND_FORMAT soundFormat = INT16;
recAudio.setRecordingOption (fileType, soundFormat, 44100, Manager::instance().getConfigString (AUDIO, RECORD_PATH));
recAudio.setRecordingOption (fileType, soundFormat, 8000, Manager::instance().getConfigString (AUDIO, RECORD_PATH));
}
......@@ -42,3 +42,11 @@ void Recordable::initRecFileName()
recAudio.initFileName (getRecFileId());
}
void Recordable::setRecordingSmplRate(int smplRate)
{
recAudio.setSndSamplingRate(smplRate);
}
......@@ -37,6 +37,8 @@ class Recordable {
void initRecFileName();
void setRecordingSmplRate(int smplRate);
virtual std::string getRecFileId() = 0;
// virtual std::string getFileName() = 0;
......
......@@ -41,7 +41,7 @@ struct wavhdr {
AudioRecord::AudioRecord()
{
sndSmplRate_ = 44100;
sndSmplRate_ = 8000;
channels_ = 1;
byteCounter_ = 0;
recordingEnabled_ = false;
......@@ -305,7 +305,7 @@ bool AudioRecord::setWavFile()
}
struct wavhdr hdr = {"RIF", 44, "WAV", "fmt", 16, 1, 1,
44100, 0, 2, 16, "dat", 0
sndSmplRate_, 0, 2, 16, "dat", 0
};
hdr.riff[3] = 'F';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment