Developer World
Spresense SDK Library v3.3.0-375c679
Audio Recognizer API
Collaboration diagram for Audio Recognizer API:

Files

file  audio_recognizer_api.h
 CXD5602 Audio Recognizer API.
 

Classes

struct  RecognizerResultHeader
 
struct  RecognizerResult
 
struct  AsActivateRecognizerParam
 
union  AsNotifyDest
 
struct  AsInitRecognizerParam
 
struct  AsStartRecognizerParam
 
struct  AsStopRecognizerParam
 
struct  AsDeactivateRecognizerParam
 
struct  AsInitRecognizerProcParam
 
struct  RecognizerCommandHeader
 
struct  RecognizerCommand
 
struct  AsRecognizerMsgQueId_t
 
struct  AsRecognizerPoolId_t
 
struct  AsCreateRecognizerParam_t
 

Macros

#define AS_FEATURE_RECOGNIZER_ENABLE
 
#define AS_RECOGNIZER_FILE_PATH_LEN   (AS_AUDIO_DSP_PATH_LEN)
 Length of Recognizer dsp file name and path.
 

Typedefs

typedef void(* RecognizerCallback) (RecognizerResult *result)
 
typedef void(* RecognizerNotifyCallback) (AsRecognitionInfo info)
 
typedef struct AsInitRecognizerProcParam AsSetRecognizerProcParam
 

Enumerations

enum  AsRecognizerEvent {
  AsRecognizerEventAct = 0 , AsRecognizerEventDeact , AsRecognizerEventInit , AsRecognizerEventStart ,
  AsRecognizerEventExec , AsRecognizerEventStop , AsRecognizerEventInitRecognizerProc , AsRecognizerEventSetRecognizerProc
}
 
enum  AsRecognizerType { AsRecognizerTypeUserCustom = 0 , AsRecognizerTypeInvalid = 0xff }
 
enum  AsRecognizerNotifyPath { AsNotifyPathCallback = 0 , AsNotifyPathMessage }
 

Functions

bool AS_CreateRecognizer (FAR AsCreateRecognizerParam_t *param, AudioAttentionCb attcb)
 Activate voice recognizer. More...
 
 __attribute__ ((deprecated("\n \ \n Deprecated create API is used. \ \n Use \"AS_CreateRecognizer(AsCreateRecognizerParam_t * \ \n AudioAttentionCb)\". \ \n \ \n"))) bool AS_CreateRecognizer(FAR AsCreateRecognizerParam_t *param)
 
bool AS_DeleteRecognizer (void)
 Deactivate voice recognizer. More...
 
bool AS_checkAvailabilityRecognizer (void)
 Check availability of Recognizer. More...
 

Packet length of command

#define LENGTH_INIT_RECOGNIZER   3
 InitRecognizer command (AUDCMD_INIT_RECOGNIZER) packet length.
 
#define LENGTH_START_RECOGNIZER   2
 StartRecognizer command (AUDCMD_START_RECOGNIZER) packet length.
 
#define LENGTH_STOP_RECOGNIZER   2
 StopRecognizer command (AUDCMD_STOP_RECOGNIZER) packet length.
 
#define LENGTH_INIT_RECOGNIZER_DSP   4
 InitRecognizeProcDSP command (AUDCMD_INIT_RECOGNIZER_DSP) packet length.
 
#define LENGTH_SET_RECOGNIZER_DSP   4
 SetRecognizeProcDSP command (AUDCMD_SET_RECOGNIZER_DSP) packet length.
 

Detailed Description

Typedef Documentation

◆ RecognizerCallback

typedef void(* RecognizerCallback) (RecognizerResult *result)

Activate parameter

◆ RecognizerNotifyCallback

typedef void(* RecognizerNotifyCallback) (AsRecognitionInfo info)

Init parameter

Enumeration Type Documentation

◆ AsRecognizerEvent

Event type of Recognizer

Enumerator
AsRecognizerEventAct 

Activate.

AsRecognizerEventDeact 

Deactivate.

AsRecognizerEventInit 

Init.

AsRecognizerEventStart 

Start.

AsRecognizerEventExec 

Exec.

AsRecognizerEventStop 

Stop.

AsRecognizerEventInitRecognizerProc 

Init RecognizerProc.

AsRecognizerEventSetRecognizerProc 

Set RecognizerProc.

◆ AsRecognizerType

Enumerator
AsRecognizerTypeUserCustom 

Recognizer type is UserCustom.

AsRecognizerTypeInvalid 

Invalid type.

◆ AsRecognizerNotifyPath

Enumerator
AsNotifyPathCallback 

Recognition result is notify by callback.

AsNotifyPathMessage 

Recognition result is notify by message.

Function Documentation

◆ AS_CreateRecognizer()

bool AS_CreateRecognizer ( FAR AsCreateRecognizerParam_t param,
AudioAttentionCb  attcb 
)

Activate voice recognizer.

Parameters
[in]paramParameters of resources used by voice recognizer
[in]attcbAttention callback of Recognizer. NULL means no callback.
Return values
true: success
false: failure

◆ AS_DeleteRecognizer()

bool AS_DeleteRecognizer ( void  )

Deactivate voice recognizer.

Return values
true: success
false: failure

◆ AS_checkAvailabilityRecognizer()

bool AS_checkAvailabilityRecognizer ( void  )

Check availability of Recognizer.

Return values
true: avaliable
false: Not available