1 /*
2  * Copyright (C) 2015-2020 Alibaba Group Holding Limited
3  */
4 #ifndef AGC_H
5 #define AGC_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     target_level;
16     int32_t     compression_gain;
17     int32_t     limiter_enable;
18 } AgcConfig;
19 
20 struct AgcState_;
21 
22 typedef struct AgcState_ AgcState;
23 
24 AgcState *agc_state_create(int32_t sample_rate, int32_t frame_size, const AgcConfig *cfg);
25 
26 int32_t agc_state_destroy(AgcState *st);
27 
28 int32_t agc_set_config(AgcState *st, const AgcConfig *cfg);
29 
30 int32_t agc_process(AgcState *st, int16_t *pcm_buf, int32_t pcm_len);
31 
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 #endif