Developer World
Spresense SDK Library release-v1.2.0-627f51e
Files | Classes | Macros | Typedefs | Enumerations | Functions
Audio Recorder API
Collaboration diagram for Audio Recorder API:

Files

file  audio_recorder_api.h
 CXD5602 Audio Recorder API.
 

Classes

struct  AsRecorderOutputDeviceHdlr
 
struct  AsActivateRecorderParam
 
struct  AsActivateRecorder
 
struct  AsInitRecorderParam
 
struct  AsRecorderMicGainParam
 
union  RecorderCommand
 
struct  AsRecorderMsgQueId_t
 
struct  AsRecorderPoolId_t
 
struct  AsCreateRecorderParam_t
 

Typedefs

typedef void(* AudioSimpleFifoWriteDoneCallbackFunction) (uint32_t size)
 
typedef bool(* MediaRecorderCallback) (AsRecorderEvent evtype, uint32_t result, uint32_t sub_result)
 

Enumerations

enum  AsRecorderEvent {
  AsRecorderEventAct = 0, AsRecorderEventInit, AsRecorderEventStart, AsRecorderEventStop,
  AsRecorderEventDeact, AsRecorderEventSetMicGain
}
 
enum  AsSetRecorderStsInputDevice {
  AS_SETRECDR_STS_INPUTDEVICE_MIC = 0, AS_SETRECDR_STS_INPUTDEVICE_I2S, AS_SETRECDR_STS_INPUTDEVICE_MIC_A = AS_SETRECDR_STS_INPUTDEVICE_MIC, AS_SETRECDR_STS_INPUTDEVICE_MIC_D = AS_SETRECDR_STS_INPUTDEVICE_MIC,
  AS_SETRECDR_STS_INPUTDEVICE_I2S_IN = AS_SETRECDR_STS_INPUTDEVICE_I2S, AS_SETRECDR_STS_INPUTDEVICE_NUM
}
 
enum  AsSetRecorderStsOutputDevice { AS_SETRECDR_STS_OUTPUTDEVICE_EMMC = 0, AS_SETRECDR_STS_OUTPUTDEVICE_RAM, AS_SETRECDR_STS_OUTPUTDEVICE_NUM }
 
enum  AsInitRecorderComputationalComplexity {
  AS_INITREC_COMPLEXITY_0 = 0, AS_INITREC_COMPLEXITY_1, AS_INITREC_COMPLEXITY_2, AS_INITREC_COMPLEXITY_3,
  AS_INITREC_COMPLEXITY_4, AS_INITREC_COMPLEXITY_5, AS_INITREC_COMPLEXITY_6, AS_INITREC_COMPLEXITY_7,
  AS_INITREC_COMPLEXITY_8, AS_INITREC_COMPLEXITY_9, AS_INITREC_COMPLEXITY_10, AS_INITREC_COMPLEXITY_NUM
}
 

Functions

bool AS_CreateMediaRecorder (FAR AsCreateRecorderParam_t *param, AudioAttentionCb attcb)
 Create audio recorder. More...
 
 __attribute__ ((deprecated("\\ \Deprecated create API is used. \ \Use \S_CreateMediaRecorder(AsCreateRecorderParam_t, \ \ AudioAttentionCb)\ \ \\ \))) bool AS_CreateMediaRecorder(FAR AsCreateRecorderParam_t *param)
 
bool AS_ActivateMediaRecorder (FAR AsActivateRecorder *actparam)
 Activate audio recorder. More...
 
bool AS_InitMediaRecorder (FAR AsInitRecorderParam *initparam)
 Init audio recorder. More...
 
bool AS_StartMediaRecorder (void)
 Start audio recorder. More...
 
bool AS_StopMediaRecorder (void)
 Stop audio recorder. More...
 
bool AS_DeactivateMediaRecorder (void)
 Deactivate audio recorder. More...
 
bool AS_DeleteMediaRecorder (void)
 Deactivate audio recorder. More...
 
bool AS_SetMicGainMediaRecorder (FAR AsRecorderMicGainParam *micgain_param)
 Set mic gain for audio recorder. More...
 

Packet length of command

#define LENGTH_START_RECORDER   2
 StartRec command (AUDCMD_STARTREC) packet length.
 
#define LENGTH_STOP_RECORDER   2
 StopRec command (AUDCMD_STOPREC) packet length.
 
#define LENGTH_INIT_RECORDER   10
 InitRecorder command (AUDCMD_INITREC) packet length.
 

Detailed Description

Typedef Documentation

◆ AudioSimpleFifoWriteDoneCallbackFunction

typedef void(* AudioSimpleFifoWriteDoneCallbackFunction) (uint32_t size)

SimpliFifo Callback function

Parameters
[in]size: Set write size after writing data to SimpleFifo

Enumeration Type Documentation

◆ AsInitRecorderComputationalComplexity

Select InitRecorder computational complexity(Opus Only)

Enumerator
AS_INITREC_COMPLEXITY_0 

Complexity = 0(lowest complexity)

AS_INITREC_COMPLEXITY_1 

Complexity = 1.

AS_INITREC_COMPLEXITY_2 

Complexity = 2.

AS_INITREC_COMPLEXITY_3 

Complexity = 2.

AS_INITREC_COMPLEXITY_4 

Complexity = 2.

AS_INITREC_COMPLEXITY_5 

Complexity = 2.

AS_INITREC_COMPLEXITY_6 

Complexity = 2.

AS_INITREC_COMPLEXITY_7 

Complexity = 2.

AS_INITREC_COMPLEXITY_8 

Complexity = 2.

AS_INITREC_COMPLEXITY_9 

Complexity = 2.

AS_INITREC_COMPLEXITY_10 

Complexity = 10 (highest complexity)

◆ AsRecorderEvent

Event type of Recorder

Enumerator
AsRecorderEventAct 

Activate.

AsRecorderEventInit 

Init.

AsRecorderEventStart 

Start.

AsRecorderEventStop 

Stop.

AsRecorderEventDeact 

Deactivate.

AsRecorderEventSetMicGain 

SetMicGain.

◆ AsSetRecorderStsInputDevice

Select Recorder input device

Enumerator
AS_SETRECDR_STS_INPUTDEVICE_MIC 

CXD5247 MIC.

AS_SETRECDR_STS_INPUTDEVICE_I2S 

I2S Input.

◆ AsSetRecorderStsOutputDevice

Select Recorder output device

Enumerator
AS_SETRECDR_STS_OUTPUTDEVICE_EMMC 

eMMC FileSystem (not supported)

AS_SETRECDR_STS_OUTPUTDEVICE_RAM 

RAM.

Function Documentation

◆ AS_ActivateMediaRecorder()

bool AS_ActivateMediaRecorder ( FAR AsActivateRecorder actparam)

Activate audio recorder.

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

◆ AS_CreateMediaRecorder()

bool AS_CreateMediaRecorder ( FAR AsCreateRecorderParam_t param,
AudioAttentionCb  attcb 
)

Create audio recorder.

Parameters
[in]paramParameters of resources used by audio recorder
[in]attcbAttention callback of Recorder. NULL means no callback.
Return values
true: success
false: failure

◆ AS_DeactivateMediaRecorder()

bool AS_DeactivateMediaRecorder ( void  )

Deactivate audio recorder.

Return values
true: success
false: failure

◆ AS_DeleteMediaRecorder()

bool AS_DeleteMediaRecorder ( void  )

Deactivate audio recorder.

Return values
true: success
false: failure

◆ AS_InitMediaRecorder()

bool AS_InitMediaRecorder ( FAR AsInitRecorderParam initparam)

Init audio recorder.

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

◆ AS_SetMicGainMediaRecorder()

bool AS_SetMicGainMediaRecorder ( FAR AsRecorderMicGainParam micgain_param)

Set mic gain for audio recorder.

Parameters
[in]gain: Mic gain
Return values
true: success
false: failure
Note
Refer to AsRecorderMicGainParam for gain setting range.

◆ AS_StartMediaRecorder()

bool AS_StartMediaRecorder ( void  )

Start audio recorder.

Return values
true: success
false: failure

◆ AS_StopMediaRecorder()

bool AS_StopMediaRecorder ( void  )

Stop audio recorder.

Return values
true: success
false: failure