Developer World
Spresense SDK Library v3.3.0-375c679
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
 
union  RecorderCommand
 
struct  AsRecorderMsgQueId_t
 
struct  AsRecorderPoolId_t
 
struct  AsRecorderPoolId_old_t
 
struct  AsCreateRecorderParam_t
 
struct  AsCreateRecorderParams_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 , AsRecorderEventDeact , AsRecorderEventInit , AsRecorderEventStart ,
  AsRecorderEventReqEncode , AsRecorderEventStop
}
 
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...
 
bool AS_CreateMediaRecorder (FAR AsCreateRecorderParams_t *param, AudioAttentionCb attcb)
 
 __attribute__ ((deprecated("\n \ \n Deprecated create API is used. \ \n Use \"AS_CreateMediaRecorder(AsCreateRecorderParam_t, \ \n AudioAttentionCb)\". \ \n \ \n"))) 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_ReqEncodeMediaRecorder (AsPcmDataParam *pcmparam)
 Request encode to 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_checkAvailabilityMediaRecorder (void)
 Check availability of MediaRecorder. 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

◆ AsRecorderEvent

Event type of Recorder

Enumerator
AsRecorderEventAct 

Activate.

AsRecorderEventDeact 

Deactivate.

AsRecorderEventInit 

Init.

AsRecorderEventStart 

Start.

AsRecorderEventReqEncode 

Req Encode.

AsRecorderEventStop 

Stop.

◆ 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

Deprecated:
It will be removed in the future
AS_SETRECDR_STS_OUTPUTDEVICE_RAM 

RAM.

◆ 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)

Function Documentation

◆ 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_ActivateMediaRecorder()

bool AS_ActivateMediaRecorder ( FAR AsActivateRecorder actparam)

Activate audio recorder.

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

◆ AS_InitMediaRecorder()

bool AS_InitMediaRecorder ( FAR AsInitRecorderParam initparam)

Init audio recorder.

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

◆ AS_ReqEncodeMediaRecorder()

bool AS_ReqEncodeMediaRecorder ( AsPcmDataParam pcmparam)

Request encode to audio recorder.

Parameters
[in]pcmparamInformation of target PCM data
Return values
true: success
false: failure

◆ 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

◆ 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_checkAvailabilityMediaRecorder()

bool AS_checkAvailabilityMediaRecorder ( void  )

Check availability of MediaRecorder.

Return values
true: avaliable
false: Not available