6. Block Diagram:

_images/BlockD002.png

6.1. Detailed code description:

(See cvi_sample_audio.c, case 10, and the cvi_aec_test.c unit-test flow):

useorthroughCVI_AI_SetTalkVqeAttr, CVI_AI_EnableVqetwoAPIwillVQEfunctionenable. CVI_AI_SetTalkVqeAttronlyneed tosetthreeitemparameterstructure

AUDIO_DEV AiDevId: Capture device ID, which must match the CVI_AI_Enable ID

AI_CHN AiCh: Capture device channel, which must match the CVI_AI_EnableChn ID

AI_TALKVQE_CONFIG_S *pstVqeConfig,

The AI_TALKVQE_CONFIG_S structure contains the following substructures:

CVI_U16 para_client_config;
CVI_U32 u32OpenMask;
CVI_S32 s32WorkSampleRate;
/* Sample Rate: 8KHz/16KHz.default: 8KHz*/
//MIC IN VQE setting
AI_AEC_CONFIG_S stAecCfg;
AUDIO_ANR_CONFIG_S stAnrCfg;
AUDIO_AGC_CONFIG_S stAgcCfg;
AUDIO_DELAY_CONFIG_S stAecDelayCfg;
CVI_S32 s32RevMask;//turn this flag to default 0x11
CVI_S32 para_notch_freq;//user can ignore this flag
CVI_CHAR customize[MAX_AUDIO_VQE_CUSTOMIZE_NAME];

[Parameters]:

AI_AEC_CONFIG_S stAecCfg;
AUDIO_ANR_CONFIG_S stAnrCfg;
AUDIO_AGC_CONFIG_S stAgcCfg;

ondescribethreeitemstructurecansetcorrespondingVQEParameters, andthroughu32OpenMasktodetermineusethiscurrentbeforeVQEneed to need towhatswitch.

s32FrameSample = 160; //每个音框采样数, 为160倍数
s32WorkSampleRate //取样率(仅支持语音采样率8000/16000)
enWorkstate = VQE_WORKSTATE_COMMON;
para_notch_freq = 0; //客制化参数,请设为0
s32RevMask = 0; //客制化设定(客制化参数), 请设为预设为0
customize //客制化屏蔽, 请设为"none"

[Switches]:

ex:

(to enable all functions)

u32OpenMask = LP_AEC_ENABLE |NLP_AES_ENABLE|NR_ENABLE|AGC_ENABLE|DCREMOVER_ENABLE|DG_ENABLE|DELAY_ENABLE

ex:

(to enable only AGC/ANR)

u32OpenMask = (AI_TALKVQE_MASK_AGC)|(AI_TALKVQE_MASK_ANR)

ex:

(enable AEC/AGC/ANR)

u32OpenMask = (AI_TALKVQE_MASK_AEC)|(AI_TALKVQE_MASK_AGC)|(AI_TALKVQE_MASK_ANR)