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

Filter incoming audio, not sent audio

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2015-01-04 02:04:07 +01:00
parent ab2f70e452
commit d042c2f346
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -226,6 +226,11 @@ void Core::playCallAudio(void* toxav, int32_t callId, const int16_t *data, uint1
if (!calls[callId].alSource) if (!calls[callId].alSource)
alGenSources(1, &calls[callId].alSource); alGenSources(1, &calls[callId].alSource);
#ifdef QTOX_FILTER_AUDIO
if (filterer[callId])
filterer[callId]->filterAudio((int16_t*) data, samples);
#endif
ToxAvCSettings dest; ToxAvCSettings dest;
if (toxav_get_peer_csettings((ToxAv*)toxav, callId, 0, &dest) == 0) if (toxav_get_peer_csettings((ToxAv*)toxav, callId, 0, &dest) == 0)
playAudioBuffer(calls[callId].alSource, data, samples, dest.audio_channels, dest.audio_sample_rate); playAudioBuffer(calls[callId].alSource, data, samples, dest.audio_channels, dest.audio_sample_rate);
@ -266,12 +271,6 @@ void Core::sendCallAudio(int callId, ToxAv* toxav)
return; return;
} }
#ifdef QTOX_FILTER_AUDIO
if (filterer[callId])
{
filterer[callId]->filterAudio((int16_t*) buf, framesize);
}
#endif
if ((r = toxav_send_audio(toxav, callId, dest, r)) < 0) if ((r = toxav_send_audio(toxav, callId, dest, r)) < 0)
{ {
qDebug() << "Core: toxav_send_audio error"; qDebug() << "Core: toxav_send_audio error";