This commit is contained in:
huxi
2025-12-03 11:12:34 +08:00
parent c23ae4f24c
commit bc195654bf
8163 changed files with 3799544 additions and 92 deletions
@@ -0,0 +1,72 @@
#ifndef _AUDIO_VOICE_CHANGER_API_H_
#define _AUDIO_VOICE_CHANGER_API_H_
#include "effects/voiceChanger_api.h"
#include "media/audio_stream.h"
enum {
V_CHANGER_ORINGIN_TYPE,
V_CHANGER_ADVANCE_TYPE,
};
struct voice_changer_update_parm { //与结构VOICECHANGER_PARM关联
u32 effect_v; //
u32 shiftv; //pitch rate: 40-250
u32 formant_shift; // 40-250
};
typedef struct _VoiceChangerParam_TOOL_SET {
int is_bypass; // 1-> byass 0 -> no bypass
struct voice_changer_update_parm parm;
} voice_changer_param_tool_set;
struct voicechanger_open_parm {
VOICECHANGER_PARM param;
u32 sample_rate;
u8 type; //0 -> VoiceChanger1 -> VoiceChanger_adv
};
typedef struct _voice_changer_hdl {
VOICECHANGER_FUNC_API *ops;
void *workbuf;
struct voicechanger_open_parm parm;
u8 update;
u8 status;
} voice_changer_hdl;
/*
* 获取变声模块默认参数;open时不传默认参数会使用内部默认参数
* 仅用于获取初值。实时参数存放在open的返回句柄parm中
*/
extern VOICECHANGER_FUNC_API *get_voiceChanger_func_api();
extern VOICECHANGER_FUNC_API *get_voiceChanger_adv_func_api();
/*
* 变声模块打开
*/
voice_changer_hdl *audio_voice_changer_open(struct voicechanger_open_parm *param);
/*
* 变声模块关闭
*/
void audio_voice_changer_close(voice_changer_hdl *hdl);
/*
* 变声模块参数更新
*/
void audio_voice_changer_update_parm(voice_changer_hdl *hdl, struct voice_changer_update_parm *parm);
/*
* 变声模块数据处理
*/
int audio_voice_changer_run(voice_changer_hdl *hdl, s16 *indata, s16 *outdata, int len, u8 ch_num);
/*
* 变声模块暂停处理
*/
void audio_voice_changer_bypass(voice_changer_hdl *hdl, u32 bypass);
#endif
#ifndef RUN_NORMAL
#define RUN_NORMAL 0
#endif
#ifndef RUN_BYPASS
#define RUN_BYPASS 1
#endif