KT25-1014_AC695x_BTE_SDK310/cpu/br23/audio_mic/mic_effect.h

289 lines
9.3 KiB
C
Raw Normal View History

2025-10-14 08:57:01 +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 设置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,70]
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_effect_set_echo_decay(u32 decay);
/*----------------------------------------------------------------------------*/
/**@brief 获取echo 回声衰减系数
@param
@return
@note
*/
/*----------------------------------------------------------------------------*/
u32 mic_effect_get_echo_decay(void);
/* [>----------------------------------------------------------------------------<] */
// [>*@brief mic_effect_cal_coef 混响喊麦、高低音 调节接口
// @param type :MIC_EQ_MODE_SHOUT_WHEAT 喊麦模式gainN喊麦开关0:关喊麦, 1开喊麦
// @param type:MIC_EQ_MODE_LOW_SOUND 低音调节 gainN调节的增益范围0~10
// @param type:MIC_EQ_MODE_HIGH_SOUND 高音调节 gainN调节的增益范围0~10
// @return
// @note 混响喊麦、高低音调节
// */
// [>----------------------------------------------------------------------------<]
// void mic_effect_cal_coef(u8 type, u32 gainN);
// [>----------------------------------------------------------------------------<]
// [>*@brief 获取EQ段数
// @param
// @return 当前EQ使用的段数
// @note
// */
// [>----------------------------------------------------------------------------<]
/* u8 mic_effect_eq_section_num(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 K歌模式音效切换例程
@param eff_mode
@return
@note
*/
/*----------------------------------------------------------------------------*/
void mic_mode_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__