1 2 #ifndef FILTER_AUDIO 3 #define FILTER_AUDIO 4 5 #include <stdint.h> 6 7 #ifndef _FILTER_AUDIO 8 typedef struct Filter_Audio Filter_Audio; 9 #endif 10 11 12 Filter_Audio *new_filter_audio(uint32_t fs); 13 14 void kill_filter_audio(Filter_Audio *f_a); 15 16 /* Enable/disable filters. 1 to enable, 0 to disable. */ 17 int enable_disable_filters(Filter_Audio *f_a, int echo, int noise, int gain, int vad); 18 19 /* Return -1 on failure. 20 Return 0 if audio was processed correctly but it didn't contain any voice. (if VAD is enabled.) 21 Return 1 if audio was processed correctly. */ 22 int filter_audio(Filter_Audio *f_a, int16_t *data, unsigned int samples); 23 24 /* Give the audio output from your software to this function so it knows what echo to cancel from the frame */ 25 int pass_audio_output(Filter_Audio *f_a, const int16_t *data, unsigned int samples); 26 27 /* Tell the echo canceller how much time in ms it takes for audio to be played and recorded back after. */ 28 int set_echo_delay_ms(Filter_Audio *f_a, int16_t msInSndCardBuf); 29 #endif 30