49 lines
1.4 KiB
C
49 lines
1.4 KiB
C
#ifndef DRC_PRO_API_H
|
||
#define DRC_PRO_API_H
|
||
|
||
#include "AudioEffect_DataType.h"
|
||
|
||
#ifdef WIN32
|
||
|
||
#define AT_DRC_PRO(x)
|
||
#define AT_DRC_PRO_CODE
|
||
#define AT_DRC_PRO_CONST
|
||
#define AT_DRC_PRO_SPARSE_CODE
|
||
#define AT_DRC_PRO_SPARSE_CONST
|
||
|
||
#else
|
||
#define AT_DRC_PRO(x) __attribute__((section(#x)))
|
||
#define AT_DRC_PRO_CODE AT_DRC_PRO(.drc_pro_code)
|
||
#define AT_DRC_PRO_CONST AT_DRC_PRO(.drc_pro_const)
|
||
#define AT_DRC_PRO_SPARSE_CODE AT_DRC_PRO(.drc_pro_sparse_code)
|
||
#define AT_DRC_PRO_SPARSE_CONST AT_DRC_PRO(.drc_pro_sparse_const)
|
||
#endif
|
||
|
||
struct drc_pro_param {
|
||
int channel;
|
||
int sample_rate;
|
||
float attack_time;
|
||
float release_time;
|
||
float compress_attack_time;
|
||
float compress_release_time;
|
||
float rms_time;
|
||
float detect_time;
|
||
float input_gain;
|
||
float output_gain;
|
||
int threshold_num;
|
||
unsigned char algorithm; // PEAK或者RMS
|
||
unsigned char mode; // 模式
|
||
unsigned char reverved[2];
|
||
int reverved1[4];
|
||
float *threshold;
|
||
af_DataType pcm_info;
|
||
};
|
||
|
||
int need_drc_pro_buf(struct drc_pro_param *param); // bufsize 与 algorithm,rmsTime channel、 sampleRate有关
|
||
int drc_pro_init(void *work_buf, struct drc_pro_param *param);
|
||
int drc_pro_update(void *work_buf, struct drc_pro_param *param);
|
||
int drc_pro_run(void *work_buf, void *indata, void *outdata, int per_channel_npoint);
|
||
|
||
|
||
#endif // !DRC_PRO_API_H
|