Developer World
Spresense SDK Library v3.2.0-ebc0364
Mic Frontend API
Collaboration diagram for Mic Frontend API:

Files

file  audio_frontend_api.h
 CXD5602 Audio Mic Frontend API.
 

Classes

struct  AsActivateFrontendParam
 
struct  AsActivateMicFrontend
 
struct  AsDeactivateMicFrontendParam
 
union  AsDataDest
 
struct  AsInitMicFrontendParam
 
struct  AsStartMicFrontendParam
 
struct  AsStopMicFrontendParam
 
struct  AsInitPreProcParam
 
struct  AsMicFrontendMicGainParam
 
struct  MicFrontendCommandHeader
 
struct  MicFrontendCommand
 
struct  AsMicFrontendMsgQueId_t
 
struct  AsMicFrontendPoolId_t
 
struct  AsMicFrontendPoolId_old_t
 
struct  AsCreateMicFrontendParam_t
 
struct  AsCreateMicFrontendParams_t
 

Macros

#define AS_FEATURE_FRONTEND_ENABLE
 
#define AS_PREPROCESS_FILE_PATH_LEN   22
 Length of Recognizer dsp file name and path.
 

Typedefs

typedef bool(* MicFrontendCallback) (AsMicFrontendEvent evtype, uint32_t result, uint32_t sub_result)
 
typedef void(* FrontendDoneCallback) (AsPcmDataParam param)
 
typedef struct AsInitPreProcParam AsSetPreProcParam
 

Enumerations

enum  AsMicFrontendEvent {
  AsMicFrontendEventAct = 0 , AsMicFrontendEventDeact , AsMicFrontendEventInit , AsMicFrontendEventStart ,
  AsMicFrontendEventStop , AsMicFrontendEventInitPreProc , AsMicFrontendEventSetPreProc , AsMicFrontendEventSetMicGain
}
 
enum  AsMicFrontendInputDevice { AsMicFrontendDeviceMic = 0 , AsMicFrontendDeviceI2S }
 
enum  AsMicFrontendPreProcType { AsMicFrontendPreProcThrough = 0 , AsMicFrontendPreProcSrc , AsMicFrontendPreProcUserCustom , AsMicFrontendPreProcInvalid = 0xff }
 
enum  AsMicFrontendDataPath { AsDataPathCallback = 0 , AsDataPathMessage , AsDataPathSimpleFIFO }
 

Functions

bool AS_CreateMicFrontend (FAR AsCreateMicFrontendParam_t *param, AudioAttentionCb attcb)
 Create mic frontend. More...
 
bool AS_CreateMicFrontend (FAR AsCreateMicFrontendParams_t *param, AudioAttentionCb attcb)
 
bool AS_ActivateMicFrontend (FAR AsActivateMicFrontend *actparam)
 Activate mic frontend. More...
 
bool AS_InitMicFrontend (FAR AsInitMicFrontendParam *initparam)
 Init mic frontend. More...
 
bool AS_StartMicFrontend (FAR AsStartMicFrontendParam *startparam)
 Start mic frontend. More...
 
bool AS_StopMicFrontend (FAR AsStopMicFrontendParam *stopparam)
 Stop mic frontend. More...
 
bool AS_InitPreprocFrontend (FAR AsInitPreProcParam *param)
 Init pre process. More...
 
bool AS_SetPreprocMicFrontend (FAR AsSetPreProcParam *param)
 Set pre process. More...
 
bool AS_SetMicGainMicFrontend (FAR AsMicFrontendMicGainParam *micgain_param)
 Set Mic gain. More...
 
bool AS_DeactivateMicFrontend (FAR AsDeactivateMicFrontendParam *deactparam)
 Deactivate mic frontend. More...
 
bool AS_DeleteMicFrontend (void)
 Delete mic frontend. More...
 
bool AS_checkAvailabilityMicFrontend (void)
 Check availability of MicFrontend. More...
 

Packet length of command

#define LENGTH_INIT_MICFRONTEND   4
 Init Mic Frontend command (AUDCMD_INIT_MICFRONTEND) packet length.
 
#define LENGTH_INIT_PREPROCESS_DSP   4
 InitPreProcessDSP command (#AUDCMD_INIT_PREPROCESS) packet length.
 
#define LENGTH_SET_PREPROCESS_DSP   4
 SetPreProcessDSP command (AUDCMD_SET_PREPROCESS_DSP) packet length.
 

Detailed Description

Typedef Documentation

◆ FrontendDoneCallback

typedef void(* FrontendDoneCallback) (AsPcmDataParam param)

InitMicFrontend Command parameter

Enumeration Type Documentation

◆ AsMicFrontendEvent

Event type of Mic FrontEnd

Enumerator
AsMicFrontendEventAct 

Activate.

AsMicFrontendEventDeact 

Deactivate.

AsMicFrontendEventInit 

Init.

AsMicFrontendEventStart 

Start.

AsMicFrontendEventStop 

Stop.

AsMicFrontendEventInitPreProc 

Init PreProc.

AsMicFrontendEventSetPreProc 

Set PreProc.

AsMicFrontendEventSetMicGain 

Set MicGain.

◆ AsMicFrontendPreProcType

Select Mic Frontend PreProcess Enable

Enumerator
AsMicFrontendPreProcThrough 

Pre Process through.

AsMicFrontendPreProcSrc 

Pre Process Sampling Rate Conveter.

AsMicFrontendPreProcUserCustom 

Pre Process user customed.

◆ AsMicFrontendDataPath

Enumerator
AsDataPathCallback 

PCM data is send by callback.

AsDataPathMessage 

PCM data is send by message.

AsDataPathSimpleFIFO 

PCM data is send by simple FIFO.

Function Documentation

◆ AS_CreateMicFrontend()

bool AS_CreateMicFrontend ( FAR AsCreateMicFrontendParam_t param,
AudioAttentionCb  attcb 
)

Create mic frontend.

Parameters
[in]paramParameters of resources used by mic frontend
[in]attcbAttention callback of Frontend. NULL means no callback.
Return values
true: success
false: failure

◆ AS_ActivateMicFrontend()

bool AS_ActivateMicFrontend ( FAR AsActivateMicFrontend actparam)

Activate mic frontend.

Parameters
[in]actparamActivation parameters
Return values
true: success
false: failure

◆ AS_InitMicFrontend()

bool AS_InitMicFrontend ( FAR AsInitMicFrontendParam initparam)

Init mic frontend.

Parameters
[in]initparamInitialization parameters
Return values
true: success
false: failure

◆ AS_StartMicFrontend()

bool AS_StartMicFrontend ( FAR AsStartMicFrontendParam startparam)

Start mic frontend.

Parameters
[in]startparamStart parameters
Return values
true: success
false: failure

◆ AS_StopMicFrontend()

bool AS_StopMicFrontend ( FAR AsStopMicFrontendParam stopparam)

Stop mic frontend.

Parameters
[in]stopparamStop parameters
Return values
true: success
false: failure

◆ AS_InitPreprocFrontend()

bool AS_InitPreprocFrontend ( FAR AsInitPreProcParam param)

Init pre process.

Return values
true: success
false: failure

◆ AS_SetPreprocMicFrontend()

bool AS_SetPreprocMicFrontend ( FAR AsSetPreProcParam param)

Set pre process.

Return values
true: success
false: failure

◆ AS_SetMicGainMicFrontend()

bool AS_SetMicGainMicFrontend ( FAR AsMicFrontendMicGainParam micgain_param)

Set Mic gain.

Return values
true: success
false: failure

◆ AS_DeactivateMicFrontend()

bool AS_DeactivateMicFrontend ( FAR AsDeactivateMicFrontendParam deactparam)

Deactivate mic frontend.

Return values
true: success
false: failure

◆ AS_DeleteMicFrontend()

bool AS_DeleteMicFrontend ( void  )

Delete mic frontend.

Return values
true: success
false: failure

◆ AS_checkAvailabilityMicFrontend()

bool AS_checkAvailabilityMicFrontend ( void  )

Check availability of MicFrontend.

Return values
true: avaliable
false: Not available