Commit 6951abab authored by Alexandre Savard's avatar Alexandre Savard

Audio record 2 buffers in sip

parent e9bb450d
......@@ -425,6 +425,8 @@ AudioRtpRTX::run () {
initBuffers();
int step;
int sessionWaiting;
//try {
// Init the session
initAudioRtpSession();
......@@ -455,6 +457,9 @@ AudioRtpRTX::run () {
////////////////////////////
// Send session
////////////////////////////
sessionWaiting = _session->isWaiting();
sendSessionFromMic(timestamp);
timestamp += step;
......@@ -465,10 +470,15 @@ AudioRtpRTX::run () {
// Let's wait for the next transmit cycle
if(_session->isWaiting())
if(sessionWaiting == 1){
_debug("Record TWO buffer \n");
_ca->recAudio.recData(spkrDataConverted,micData,_nSamplesSpkr,_nSamplesMic);
else
}
else {
_debug("Record ONE buffer \n");
_ca->recAudio.recData(micData,_nSamplesMic);
}
Thread::sleep(TimerPort::getTimer());
TimerPort::incTimer(_layerFrameSize); // 'frameSize' ms
......
......@@ -460,8 +460,8 @@ void AudioRecord::recData(SFLDataFormat* buffer_1, SFLDataFormat* buffer_2, int
if ( sndFormat_ == INT16 ) { // TODO change INT16 to SINT16
for (int k=0; k<nSamples_1; k++){
// mixBuffer_[k] = ((buffer_1[k]+buffer_2[k])/2)/32767;
mixBuffer_[k] = (buffer_1[k]+buffer_2[k]);
// dsp.getRMS(mixBuffer_[k]);
if ( fwrite(&buffer_1[k], 2, 1, fp) != 1)
......
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