1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 #ifndef COMPEXP_H 5 #define COMPEXP_H 6 7 #include <stdint.h> 8 9 typedef struct 10 { 11 int32_t bypass; 12 float comp_threshold; 13 float comp_ratio; 14 float expand_threshold; 15 float expand_ratio; 16 float attack_time; 17 float release_time; 18 float makeup_gain; 19 int32_t delay; 20 } CompexpConfig; 21 22 typedef struct CompexpState_ CompexpState; 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 CompexpState *compexp_create(int32_t sample_rate, int32_t frame_size, const CompexpConfig *config); 29 30 int32_t compexp_destroy(CompexpState *st); 31 32 int32_t compexp_set_config(CompexpState *st, const CompexpConfig *cfg); 33 34 int32_t compexp_process(CompexpState *st, int16_t *pcm_buf, int32_t pcm_len); 35 36 float compexp_get_required_mips(CompexpState *st); 37 38 #ifdef __cplusplus 39 } 40 #endif 41 42 #endif