1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 #ifndef __SPEECH_3MIC_NS_H__ 5 #define __SPEECH_3MIC_NS_H__ 6 7 #include <stdint.h> 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 typedef struct { 14 int32_t bypass; 15 int32_t blend_en; 16 int32_t authen_en; 17 float delay_tapsM; // MIC L/R delay samples. 0: 适用于麦克距离为<2cm; 1: 适用于麦克距离为2cm左右; 2: 适用于麦克距离为4cm左右 18 int32_t delay_tapsS; 19 float denoise_dB; 20 // float coefH[2][5]; // {{a0,a1,a2,a3,a4},{b0,b1,b2,b3,b4}} 21 // float coefL[2][5]; // {{a0,a1,a2,a3,a4},{b0,b1,b2,b3,b4}} 22 int32_t crossover_freq; 23 int32_t freq_smooth_enable; // 1: 频域滤波打开; 0: 频域滤波关闭; 默认打开 24 int32_t wnr_enable; // wind noise reduction enable 25 } Speech3MicNsConfig; 26 27 struct Speech3MicNsState_; 28 29 typedef struct Speech3MicNsState_ Speech3MicNsState; 30 31 Speech3MicNsState *speech_3mic_ns_create(int32_t sample_rate, int32_t frame_size, const Speech3MicNsConfig *cfg); 32 33 int32_t speech_3mic_ns_destroy(Speech3MicNsState *st); 34 35 int32_t speech_3mic_ns_set_config(Speech3MicNsState *st, const Speech3MicNsConfig *cfg); 36 37 int32_t speech_3mic_ns_process(Speech3MicNsState *st, short *pcm_buf, int32_t pcm_len, short *out_buf); 38 39 #ifdef __cplusplus 40 } 41 #endif 42 43 #endif 44