1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Filter audio checkbox has effect mid-call

This commit is contained in:
Dubslow 2015-03-11 21:13:18 -05:00
parent 2f2e51fb6a
commit e9babcee07
No known key found for this signature in database
GPG Key ID: 3DB8E05315C220AA

View File

@ -76,7 +76,7 @@ void Core::prepareCall(int friendId, int callId, ToxAv* toxav, bool videoEnabled
#ifdef QTOX_FILTER_AUDIO
if (Settings::getInstance().getFilterAudio())
{
Core::filterer[callId] = new AudioFilterer();
filterer[callId] = new AudioFilterer();
filterer[callId]->startFilter(48000);
}
else
@ -257,13 +257,23 @@ void Core::sendCallAudio(int callId, ToxAv* toxav)
if (Audio::tryCaptureSamples(buf, framesize))
{
#ifdef QTOX_FILTER_AUDIO
if (filterer[callId])
if (Settings::getInstance().getFilterAudio())
{
if (!filterer[callId])
{
filterer[callId] = new AudioFilterer();
filterer[callId]->startFilter(48000);
}
// is a null op #ifndef ALC_LOOPBACK_CAPTURE_SAMPLES
Audio::getEchoesToFilter(filterer[callId], framesize);
filterer[callId]->filterAudio((int16_t*) buf, framesize);
}
else if (filterer[callId])
{
delete filterer[callId];
filterer[callId] = nullptr;
}
#endif
uint8_t dest[bufsize];