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

[#1933] Add "audio codec not determined" error in IAX

parent 4938484b
Branches
Tags
No related merge requests found
......@@ -245,20 +245,19 @@ IAXVoIPLink::getEvent()
if (call) {
call->recAudio.recData (spkrDataConverted,micData,nbSampleForRec_,nbSampleForRec_);
// Do the doodle-moodle to send audio from the microphone to the IAX channel.
sendAudioFromMic();
}
// Do the doodle-moodle to send audio from the microphone to the IAX channel.
sendAudioFromMic();
// sendAudioFromMic();
// Refresh registration.
if (_nextRefreshStamp && _nextRefreshStamp - 2 < time (NULL)) {
sendRegister ("");
}
// reinitialize speaker buffer for recording (when recording a voice mail)
// for (int i = 0; i < nbSampleForRec_; i++)
// spkrDataConverted[i] = 0;
// thread wait 3 millisecond
_evThread->sleep (3);
......@@ -285,7 +284,7 @@ IAXVoIPLink::sendAudioFromMic (void)
if (!currentCall) {
_debug("Error no iax call with id \"%s\"\n", Manager::instance().getCurrentCallId().c_str());
// Let's mind our own business.
return;
}
......@@ -305,23 +304,26 @@ IAXVoIPLink::sendAudioFromMic (void)
return;
}
ac = currentCall->getCodecMap().getCodec (currentCall -> getAudioCodec());
ac = currentCall->getCodecMap().getCodec (currentCall->getAudioCodec());
if (!ac) {
// Audio codec still not determined.
_debug("Error no audio codec determined!\n");
if (audiolayer) {
// To keep latency low..
audiolayer->flushMic();
audiolayer->getMainBuffer()->flush(currentCall->getCallId());
}
return;
}
audiolayer->getMainBuffer()->setInternalSamplingRate(ac->getClockRate());
// Send sound here
if (audiolayer) {
audiolayer->getMainBuffer()->setInternalSamplingRate(ac->getClockRate());
int _mainBufferSampleRate = audiolayer->getMainBuffer()->getInternalSamplingRate();
// we have to get 20ms of data from the mic *20/1000 = /50
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment