1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
We need to filter samples * channels; also cleaned up data types
This commit is contained in:
Nils Fenner 2015-11-21 11:44:59 +01:00
parent 44d1c6fe74
commit a1b87194b8
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C
3 changed files with 6 additions and 6 deletions

View File

@ -25,7 +25,7 @@ extern "C"{
#include <filter_audio.h>
}
void AudioFilterer::startFilter(unsigned int fs)
void AudioFilterer::startFilter(uint32_t fs)
{
closeFilter();
filter = new_filter_audio(fs);
@ -38,9 +38,9 @@ void AudioFilterer::closeFilter()
filter = nullptr;
}
bool AudioFilterer::filterAudio(int16_t* data, int framesize)
bool AudioFilterer::filterAudio(int16_t* data, unsigned int samples)
{
return filter && 0 == filter_audio(filter, (int16_t*) data, framesize);
return filter && 0 == filter_audio(filter, data, samples);
}
/* Enable/disable filters. 1 to enable, 0 to disable. */

View File

@ -33,13 +33,13 @@ public:
explicit AudioFilterer(const AudioFilterer&) = delete;
~AudioFilterer();
AudioFilterer operator=(const AudioFilterer) = delete;
void startFilter(unsigned int fs);
void startFilter(uint32_t fs);
void closeFilter();
/* Enable/disable filters. 1 to enable, 0 to disable. */
bool enableDisableFilters(int echo, int noise, int gain, int vad);
bool filterAudio(int16_t* data, int samples);
bool filterAudio(int16_t* data, unsigned int samples);
/* Give the audio output from your software to this function so it knows what echo to cancel from the frame */
bool passAudioOutput(const int16_t *data, int samples);

View File

@ -416,7 +416,7 @@ bool CoreAV::sendGroupCallAudio(int groupId)
// is a null op #ifndef ALC_LOOPBACK_CAPTURE_SAMPLES
Audio::getEchoesToFilter(call.filterer, AUDIO_FRAME_SAMPLE_COUNT);
call.filterer->filterAudio(buf, AUDIO_FRAME_SAMPLE_COUNT);
call.filterer->filterAudio(buf, AUDIO_FRAME_SAMPLE_COUNT * AUDIO_CHANNELS);
}
else if (call.filterer)
{