KT24-1110_65E-HA-651B/cpu/br25/audio_mic/mic_effect.h

358 lines
11 KiB
C
Raw Permalink Normal View History

2024-11-10 10:44:17 +00:00
#ifndef __MIC_EFFECT_H__
#define __MIC_EFFECT_H__
#include "system/includes.h"
#include "audio_mic/effect_reg.h"
#include "audio_mic/effect_parm.h"
#include "app_config.h"
#include "application/audio_pemafrow.h"
/* enum { */
// MIC_EQ_MODE_SHOUT_WHEAT = 0x0,
// MIC_EQ_MODE_LOW_SOUND,
// MIC_EQ_MODE_HIGH_SOUND,
/* }; */
void switch_mic_effect_mode(void);
// void set_mic_reverb_mode(void);
void switch_mic_agc(void);
/*----------------------------------------------------------------------------*/
/**@brief (mic数据流)混响打开接口
@param
@return true - , false - .
@note
*/
/*----------------------------------------------------------------------------*/
bool mic_effect_start(void);
/*----------------------------------------------------------------------------*/
/**@brief (mic数据流)混响关闭接口
@param
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_stop(void);
/*----------------------------------------------------------------------------*/
/**@brief (mic数据流)混响暂停接口(数据置0)
@param mark :1 0
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_pause(u8 mark);
/*----------------------------------------------------------------------------*/
/**@brief (mic数据流)混响暂停输出到DAC(数据流后级不写入DAC)
@param mark :1 0
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_dac_pause(u8 mark);
/*----------------------------------------------------------------------------*/
/**@brief (mic数据流)混响状态获取接口
@param
@return true - , false -
@note
*/
/*----------------------------------------------------------------------------*/
u8 mic_effect_get_status(void);
/*----------------------------------------------------------------------------*/
/**@brief 数字音量调节接口
@param vol [0,31]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_dvol(u8 vol);
/*----------------------------------------------------------------------------*/
/**@brief 获取数字音量接口
@param
@return
@note
*/
/*----------------------------------------------------------------------------*/
u8 mic_effect_get_dvol(void);
/*----------------------------------------------------------------------------*/
/**@brief 获取默认mic增益
@param
@return mic增益值
@note
*/
/*----------------------------------------------------------------------------*/
u8 mic_effect_get_micgain(void);
/*----------------------------------------------------------------------------*/
/**@brief 设置reverb 湿声增益
@param [0,300]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_reverb_wet(int wet);
/*----------------------------------------------------------------------------*/
/**@brief 获取当前reverb混响湿声增益值
@param
@return [0,300]
@note
*/
/*----------------------------------------------------------------------------*/
int mic_effect_get_reverb_wet(void);
/*----------------------------------------------------------------------------*/
/**@brief 设置reverb 干声增益
@param [0,200]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_reverb_dry(int wet);
/*----------------------------------------------------------------------------*/
/**@brief 获取当前reverb混响干声增益值
@param
@return [0,200]
@note
*/
/*----------------------------------------------------------------------------*/
int mic_effect_get_reverb_dry(void);
/*----------------------------------------------------------------------------*/
/**@brief 设置echo 回声延时
@param delay [0,max_ms]
@return
@note max_ms = 200
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_echo_delay(u32 delay);
/*----------------------------------------------------------------------------*/
/**@brief 获取当前 echo 回声延时值
@param
@return delay值
@note
*/
/*----------------------------------------------------------------------------*/
u32 mic_effect_get_echo_delay(void);
/*----------------------------------------------------------------------------*/
/**@brief 设置echo 回声衰减系数
@param decay %[0,90]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_echo_decay(u32 decay);
/*----------------------------------------------------------------------------*/
/**@brief 获取echo 回声衰减系数
@param
@return
@note
*/
/*----------------------------------------------------------------------------*/
u32 mic_effect_get_echo_decay(void);
/*----------------------------------------------------------------------------*/
/**@brief 设置echo 回声wetgain参数
@param wetgain 湿%[0,200]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_echo_wetgain(u32 wetgain);
/*----------------------------------------------------------------------------*/
/**@brief 获取echo 回声wetgain参数
@param wetgain 湿%[0,200]
@return
@note
*/
/*----------------------------------------------------------------------------*/
u32 mic_effect_get_echo_wetgain(void);
/*----------------------------------------------------------------------------*/
/**@brief 设置echo 回声drygain参数
@param drygain %[0,100]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_echo_drygain(u32 drygain);
/*----------------------------------------------------------------------------*/
/**@brief 获取echo 回声drygain参数
@param drygain %[0,100]
@return
@note
*/
/*----------------------------------------------------------------------------*/
u32 mic_effect_get_echo_drygain(void);
/*----------------------------------------------------------------------------*/
/**@brief mic数据流参数更新
@param parm
@return
@note 使
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_mic_parm(struct __mic_stream_parm *parm);
/*----------------------------------------------------------------------------*/
/**@brief 设置变声模式
@param shiftv:
sr
effect:[40,230]
formant_shift: [40,230]
@return
@note
1.EFFECT_PITCH_SHIFT shiftv调节有效formant_shift调节无效
2.EFFECT_VOICECHANGE_KIN0 shiftv formant_shift
3.EFFECT_VOICECHANGE_KIN1 EFFECT_VOICECHANGE_KIN0类似的2
4.EFFECT_ROBORT
5.EFFECT_AUTOTUNE
*/
/*----------------------------------------------------------------------------*/
// void set_pitch_para(u32 shiftv, u32 sr, u8 effect, u32 formant_shift);
/*----------------------------------------------------------------------------*/
/**@brief 设置音效模式
@param mode
@return
@note
effect_reg_echo.c和effect_reg_reverb.c中定义
*/
/*----------------------------------------------------------------------------*/
void mic_effect_change_mode(u16 mode);
/*----------------------------------------------------------------------------*/
/**@brief 获取音效模式
@param
@return
@note 使
*/
/*----------------------------------------------------------------------------*/
u16 mic_effect_get_cur_mode(void);
/*----------------------------------------------------------------------------*/
/**@brief 能量检测运行过程,是否触发闪避
@param
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_dodge_ctr(void);
/*----------------------------------------------------------------------------*/
/**@brief 能量检测运行过程,是否触发闪避
@param
@return
@note
*/
/*----------------------------------------------------------------------------*/
u8 mic_dodge_get_status(void);
/*----------------------------------------------------------------------------*/
/**@brief mic eq信息获取接口
@param index:eq
@return struct eq_seg_info结构体
@note
*/
/*----------------------------------------------------------------------------*/
// struct eq_seg_info *mic_eq_get_info(u16 index);
/*----------------------------------------------------------------------------*/
/**@brief mic eq设置接口
@param struct eq_seg_info结构体
@return
@note
*/
/*----------------------------------------------------------------------------*/
// int mic_eq_set_info(struct eq_seg_info *info);
//
//
/*----------------------------------------------------------------------------*/
/**@brief 变声音调重置为原声音调
@param NULL
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_pitchv_reset_parm(void);
/*----------------------------------------------------------------------------*/
/**@brief 变声音调递增
@param NULL
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_pitchv_up(void);
/*----------------------------------------------------------------------------*/
/**@brief 变声音调递减
@param NULL
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_pitchv_down(void);
/*----------------------------------------------------------------------------*/
/**@brief 变声音效循环切换
@param NULL
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_voicechange_loop(void);
/*----------------------------------------------------------------------------*/
/**@brief 变声音效指定模式切换
@param eff_mode
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_voicechange_switch(u8 eff_mode);
/*----------------------------------------------------------------------------*/
/**@brief 混响mic数据到USB mic 开关
@param mark : true false
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_to_usbmic_onoff(u8 mark);
#endif// __MIC_EFFECT_H__