1 /*
2  * Copyright (C) 2015-2020 Alibaba Group Holding Limited
3  */
4 #ifndef __SPEECH_GAIN_H__
5 #define __SPEECH_GAIN_H__
6 
7 #include <stdint.h>
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 #define SPEECH_GAIN_SET_AAA          (0)
14 #define SPEECH_GAIN_GET_AAA          (1)
15 
16 typedef struct {
17     int32_t     bypass;
18     float       gain_dB;
19 } SpeechGainConfig;
20 
21 struct SpeechGainState_;
22 
23 typedef struct SpeechGainState_ SpeechGainState;
24 
25 // Creat a instance from speech_gain module/class
26 // Common value include: sample rate, frame size and so on.
27 SpeechGainState *speech_gain_create(int32_t sample_rate, int32_t frame_size, const SpeechGainConfig *cfg);
28 
29 // Destory a speech gain instance
30 int32_t speech_gain_destroy(SpeechGainState *st);
31 
32 // Just use modify instance configure
33 int32_t speech_gain_set_config(SpeechGainState *st, const SpeechGainConfig *cfg);
34 
35 // Get/set some value or enable/disable some function
36 // int32_t speech_gain_ctl(SpeechGainState *st, int32_t ctl, void *ptr);
37 
38 // Process speech stream
39 int32_t speech_gain_process(SpeechGainState *st, int16_t *pcm_buf, int32_t pcm_len);
40 
41 // Debug speech_gain instance
42 int32_t speech_gain_dump(SpeechGainState *st);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif
49