mirror of https://github.com/qTox/qTox.git
Browse Source
The filter_audio API is not working for qTox/Tox and thus disabled by default via compiler switch. In current qTox UI, it is not configurable, even when this switch is enabled. According to issue #3194 the library is no longer maintained as well. I don't see any reason to keep it in qTox.pull/3351/head
17 changed files with 5 additions and 368 deletions
@ -1,69 +0,0 @@
@@ -1,69 +0,0 @@
|
||||
/*
|
||||
Copyright © 2014-2015 by The qTox Project |
||||
|
||||
This file is part of qTox, a Qt-based graphical interface for Tox. |
||||
|
||||
qTox is libre software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
qTox is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with qTox. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/ |
||||
|
||||
|
||||
#ifdef QTOX_FILTER_AUDIO |
||||
|
||||
#include "audiofilterer.h" |
||||
extern "C"{ |
||||
#include <filter_audio.h> |
||||
} |
||||
|
||||
void AudioFilterer::startFilter(uint32_t fs) |
||||
{ |
||||
closeFilter(); |
||||
filter = new_filter_audio(fs); |
||||
} |
||||
|
||||
void AudioFilterer::closeFilter() |
||||
{ |
||||
if (filter) |
||||
kill_filter_audio(filter); |
||||
filter = nullptr; |
||||
} |
||||
|
||||
bool AudioFilterer::filterAudio(int16_t* data, unsigned int samples) |
||||
{ |
||||
return filter && 0 == filter_audio(filter, data, samples); |
||||
} |
||||
|
||||
/* Enable/disable filters. 1 to enable, 0 to disable. */ |
||||
bool AudioFilterer::enableDisableFilters(int echo, int noise, int gain, int vad) |
||||
{ |
||||
return filter && 0 == enable_disable_filters(filter, echo, noise, gain, vad); |
||||
} |
||||
|
||||
/* Give the audio output from your software to this function so it knows what echo to cancel from the frame */ |
||||
bool AudioFilterer::passAudioOutput(const int16_t *data, int samples) |
||||
{ |
||||
return filter && 0 == pass_audio_output(filter, data, samples); |
||||
} |
||||
|
||||
/* Tell the echo canceller how much time in ms it takes for audio to be played and recorded back after. */ |
||||
bool AudioFilterer::setEchoDelayMs(int16_t msInSndCardBuf) |
||||
{ |
||||
return filter && 0 == set_echo_delay_ms(filter, msInSndCardBuf); |
||||
} |
||||
|
||||
AudioFilterer::~AudioFilterer() |
||||
{ |
||||
closeFilter(); |
||||
} |
||||
|
||||
#endif // QTOX_FILTER_AUDIO
|
@ -1,55 +0,0 @@
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
Copyright © 2014-2015 by The qTox Project |
||||
|
||||
This file is part of qTox, a Qt-based graphical interface for Tox. |
||||
|
||||
qTox is libre software: you can redistribute it and/or modify |
||||
it under the terms of the GNU General Public License as published by |
||||
the Free Software Foundation, either version 3 of the License, or |
||||
(at your option) any later version. |
||||
|
||||
qTox is distributed in the hope that it will be useful, |
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
GNU General Public License for more details. |
||||
|
||||
You should have received a copy of the GNU General Public License |
||||
along with qTox. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/ |
||||
|
||||
#ifdef QTOX_FILTER_AUDIO |
||||
#ifndef AUDIOFILTERER_H |
||||
#define AUDIOFILTERER_H |
||||
#include <cstdint> |
||||
|
||||
#ifndef _FILTER_AUDIO |
||||
typedef struct Filter_Audio Filter_Audio; |
||||
#endif |
||||
|
||||
class AudioFilterer |
||||
{ |
||||
public: |
||||
explicit AudioFilterer() = default; |
||||
explicit AudioFilterer(const AudioFilterer&) = delete; |
||||
~AudioFilterer(); |
||||
AudioFilterer operator=(const AudioFilterer) = delete; |
||||
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, 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); |
||||
|
||||
/* Tell the echo canceller how much time in ms it takes for audio to be played and recorded back after. */ |
||||
bool setEchoDelayMs(int16_t msInSndCardBuf); |
||||
|
||||
private: |
||||
struct Filter_Audio* filter{nullptr}; |
||||
}; |
||||
|
||||
#endif // AUDIOFILTERER_H
|
||||
#endif // QTOX_FILTER_AUDIO
|
Loading…
Reference in new issue