AEC APIs

[English]

重要

The AEC API v1.0 is the lastest stable AEC APIs. All new applications should use AEC API v1.0.

AEC API Categories

AEC APIs:

API Reference

Header File

Functions

uint32_t aec_size(uint32_t delay)

Get AECContext size (byte)

参数

delay – delay samples

返回

  • uint32_t: size(byte)

void aec_init(AECContext *aec, int16_t fs)

Init aec.

This API init aec function :

  • Set aec parameters

  • Init fft parameters

Usage example:

AECContext* aec = NULL;

//malloc aec memory
aec = (AECContext*)os_malloc(aec_size());

//init aec
aec_init(aec, 16000);

参数
  • aec – aec parameters

  • fs – frame sample 8K/16K

返回

none

void aec_ctrl(AECContext *aec, uint32_t cmd, uint32_t arg)

Control aec.

This API control aec function :

  • Set aec parameters

  • Get data addr

Usage example:

AECContext* aec = NULL;

//malloc aec memory
aec = (AECContext*)os_malloc(aec_size());

//init aec
aec_init(aec, 16000);

//set mic delay
aec_ctrl(aec, AEC_CTRL_CMD_SET_MIC_DELAY, 10);

参数
  • aec – aec parameters

  • cmd – control command in enum AEC_CTRL_CMD

  • arg – value

返回

none

void aec_proc(AECContext *aec, int16_t *rin, int16_t *sin, int16_t *out)

Control aec.

This API control aec function :

  • Set aec parameters

  • Get data addr

Usage example:

AECContext* aec = NULL;

//malloc aec memory
aec = (AECContext*)os_malloc(aec_size());

//init aec
aec_init(aec, 16000);

//aec excute work
aec_proc (aec, rin, sin, out);

参数
  • aec – aec parameters

  • rin – reference data

  • sin – source data

  • out – output data

返回

none

Type Definitions

typedef struct _AECContext AECContext

Enumerations

enum AEC_CTRL_CMD

Values:

enumerator AEC_CTRL_CMD_NULL
enumerator AEC_CTRL_CMD_GET_MIC_DELAY

Get mic delay

enumerator AEC_CTRL_CMD_SET_MIC_DELAY

Set mic delay

enumerator AEC_CTRL_CMD_GET_EC_DEPTH

Get ec depth

enumerator AEC_CTRL_CMD_SET_EC_DEPTH

Set ec depth

enumerator AEC_CTRL_CMD_GET_NS_LEVEL

Get ns level

enumerator AEC_CTRL_CMD_SET_NS_LEVEL

Set ns level

enumerator AEC_CTRL_CMD_GET_DRC

Get drc

enumerator AEC_CTRL_CMD_SET_DRC

Set drc

enumerator AEC_CTRL_CMD_GET_FLAGS

Get flags

enumerator AEC_CTRL_CMD_SET_FLAGS

Set flags

enumerator AEC_CTRL_CMD_SET_VOL

Set volum

enumerator AEC_CTRL_CMD_SET_REF_SCALE

Set reference scale

enumerator AEC_CTRL_CMD_SET_TxRxThr

Set TxRxThr

enumerator AEC_CTRL_CMD_SET_TxRxFlr

Set TxRxFlr

enumerator AEC_CTRL_CMD_SET_ECRSD1

Set ECRSD1

enumerator AEC_CTRL_CMD_SET_ECRSD2

Set ECRSD2

enumerator AEC_CTRL_CMD_SET_RSDBAND

Set RSDBAND

enumerator AEC_CTRL_CMD_SET_NS_PARA

Set ns parameter

enumerator AEC_CTRL_CMD_SET_PARAMS

Set parameters

enumerator AEC_CTRL_CMD_SET_EC_COE

Set EC_COE

enumerator AEC_CTRL_CMD_SET_DRC_TAB

Set DRC_TAB

enumerator AEC_CTRL_CMD_GET_RX_BUF

Get rx buffer addr

enumerator AEC_CTRL_CMD_GET_TX_BUF

Get tx buffer addr

enumerator AEC_CTRL_CMD_GET_OUT_BUF

Get output buffer addr

enumerator AEC_CTRL_CMD_GET_FRAME_SAMPLE

Get frame sample