mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix #2504
We need to filter samples * channels; also cleaned up data types
This commit is contained in:
parent
44d1c6fe74
commit
a1b87194b8
|
@ -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. */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user