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:
parent
2f2e51fb6a
commit
e9babcee07
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue
Block a user