- add stun server IP setting + fix problem when processing incoming audio data

This commit is contained in:
2022-09-08 20:54:01 +03:00
parent 93d53957a2
commit eabc1b5c3d
5 changed files with 26 additions and 10 deletions

View File

@@ -730,7 +730,11 @@ void AudioReceiver::initPvqa()
if (!mPVQA)
{
mPVQA = std::make_shared<sevana::pvqa>();
mPVQA->open(AUDIO_SAMPLERATE, 1, PVQA_INTERVAL);
bool is_opened = mPVQA->open(AUDIO_SAMPLERATE, 1, PVQA_INTERVAL);
if (!is_opened)
{
//
}
}
}
@@ -753,7 +757,11 @@ void AudioReceiver::updatePvqa(const void *data, int size)
int time4pvqa = (int)(frames * PVQA_INTERVAL * 1000);
int size4pvqa = (int)fmt.sizeFromTime(time4pvqa);
ICELogDebug(<< "PVQA buffer has " << time4pvqa << " milliseconds of audio.");
mPVQA->update(mPvqaBuffer->data(), size4pvqa);
bool update_result = mPVQA->update(mPvqaBuffer->data(), size4pvqa);
if (!update_result)
{
//
}
mPvqaBuffer->erase(size4pvqa);
}
}