Developer World
Spresense SDK Library v3.2.0-ebc0364
Audio Synthesizer API
Collaboration diagram for Audio Synthesizer API:

Files

file  audio_synthesizer_api.h
 CXD5602 Audio Synthesizer API.
 

Classes

struct  AsActivateSynthesizer
 
union  AsSynthesizerDataDest
 
struct  AsInitSynthesizerParam
 
struct  AsSetSynthesizer
 
struct  AsSynthesizerMsgQueId_t
 
struct  AsSynthesizerPoolId_t
 
struct  AsCreateSynthesizerParam_t
 

Typedefs

typedef bool(* SynthesizerCallback) (AsSynthesizerEvent evtype, uint32_t result, void *param)
 
typedef void(* SynthesizerDoneCallback) (AsPcmDataParam param)
 

Enumerations

enum  AsSynthesizerEvent {
  AsSynthesizerEventAct = 0 , AsSynthesizerEventInit , AsSynthesizerEventStart , AsSynthesizerEventStop ,
  AsSynthesizerEventDeact , AsSynthesizerEventSet , AsSynthesizerEventNum
}
 
enum  AsSynthesizerWaveMode {
  InvalidWave = 0xffffffff , AsSynthesizerSinWave = 0 , AsSynthesizerRectWave , AsSynthesizerSawWave ,
  AsSynthesizerWaveModeNum
}
 
enum  AsSynthesizerChannelNum { AsSynthesizerMaxChannelNum = 8 }
 
enum  AsSynthesizerDataPath { AsSynthesizerDataPathCallback = 0 , AsSynthesizerDataPathMessage }
 

Functions

bool AS_CreateMediaSynthesizer (FAR AsCreateSynthesizerParam_t *param, AudioAttentionCb attcb)
 Create audio synthesizer. More...
 
 __attribute__ ((deprecated("\n \ \n Deprecated create API is used. \ \n Use \"AS_CreateMediaSynthesizer(AsCreateSynthesizerParam_t, \ \n AudioAttentionCb)\". \ \n \ \n"))) bool AS_CreateMediaSynthesizer(FAR AsCreateSynthesizerParam_t *param)
 
bool AS_ActivateMediaSynthesizer (FAR AsActivateSynthesizer *actparam)
 Activate audio synthesizer. More...
 
bool AS_InitMediaSynthesizer (FAR AsInitSynthesizerParam *initparam)
 Init audio synthesizer. More...
 
bool AS_StartMediaSynthesizer (void)
 Start audio synthesizer. More...
 
bool AS_StopMediaSynthesizer (void)
 Stop audio synthesizer. More...
 
bool AS_SetFrequencyMediaSynthesizer (FAR AsSetSynthesizer *set_param)
 Set audio synthesizer at frequency. More...
 
bool AS_SetEnvelopeMediaSynthesizer (FAR AsSetSynthesizer *set_param)
 Set audio synthesizer at envelope. More...
 
bool AS_SetMediaSynthesizer (FAR AsSetSynthesizer *set_param)
 Deactivate audio synthesizer. More...
 
bool AS_DeactivateMediaSynthesizer (void)
 Deactivate audio synthesizer. More...
 
bool AS_DeleteMediaSynthesizer (void)
 Deactivate audio synthesizer. More...
 
bool AS_ReleaseMediaSynthesizer (bool is_end)
 Deactivate audio synthesizer. More...
 

Packet length of command

#define LENGTH_INIT_SYNTHESIZER   10
 InitSynthesizer command (#AUDCMD_INITSYN) packet length.
 
#define LENGTH_START_SYNTHESIZER   2
 StartSyn command (#AUDCMD_STARTSYN) packet length.
 
#define LENGTH_STOP_SYNTHESIZER   2
 StopSyn command (#AUDCMD_STOPSYN) packet length.
 

Detailed Description

Typedef Documentation

◆ SynthesizerCallback

typedef bool(* SynthesizerCallback) (AsSynthesizerEvent evtype, uint32_t result, void *param)

SetSynthesizerStatus Command (#AUDCMD_SETSYNTHESIZERSTATUS) parameter

◆ SynthesizerDoneCallback

typedef void(* SynthesizerDoneCallback) (AsPcmDataParam param)

InitSynthesizer Command (#AUDCMD_INITSYN) parameter

Enumeration Type Documentation

◆ AsSynthesizerEvent

Event type of Synthesizer

Enumerator
AsSynthesizerEventAct 

Activate.

AsSynthesizerEventInit 

Init.

AsSynthesizerEventStart 

Start.

AsSynthesizerEventStop 

Stop.

AsSynthesizerEventDeact 

Deactivate.

AsSynthesizerEventSet 

Set.

◆ AsSynthesizerWaveMode

Waveform of Synthesizer

Enumerator
AsSynthesizerSinWave 

Waveform.

◆ AsSynthesizerChannelNum

Number of channels

Enumerator
AsSynthesizerMaxChannelNum 

Maximum number of channels.

◆ AsSynthesizerDataPath

Select synthesizer data path

Enumerator
AsSynthesizerDataPathCallback 

PCM data is send by callback.

AsSynthesizerDataPathMessage 

PCM data is send by message.

Function Documentation

◆ AS_CreateMediaSynthesizer()

bool AS_CreateMediaSynthesizer ( FAR AsCreateSynthesizerParam_t param,
AudioAttentionCb  attcb 
)

Create audio synthesizer.

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

◆ AS_ActivateMediaSynthesizer()

bool AS_ActivateMediaSynthesizer ( FAR AsActivateSynthesizer actparam)

Activate audio synthesizer.

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

◆ AS_InitMediaSynthesizer()

bool AS_InitMediaSynthesizer ( FAR AsInitSynthesizerParam initparam)

Init audio synthesizer.

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

◆ AS_StartMediaSynthesizer()

bool AS_StartMediaSynthesizer ( void  )

Start audio synthesizer.

Return values
true: success
false: failure

◆ AS_StopMediaSynthesizer()

bool AS_StopMediaSynthesizer ( void  )

Stop audio synthesizer.

Return values
true: success
false: failure

◆ AS_SetFrequencyMediaSynthesizer()

bool AS_SetFrequencyMediaSynthesizer ( FAR AsSetSynthesizer set_param)

Set audio synthesizer at frequency.

Return values
true: success
false: failure

◆ AS_SetEnvelopeMediaSynthesizer()

bool AS_SetEnvelopeMediaSynthesizer ( FAR AsSetSynthesizer set_param)

Set audio synthesizer at envelope.

Return values
true: success
false: failure

◆ AS_SetMediaSynthesizer()

bool AS_SetMediaSynthesizer ( FAR AsSetSynthesizer set_param)

Deactivate audio synthesizer.

Return values
true: success
false: failure

◆ AS_DeactivateMediaSynthesizer()

bool AS_DeactivateMediaSynthesizer ( void  )

Deactivate audio synthesizer.

Return values
true: success
false: failure

◆ AS_DeleteMediaSynthesizer()

bool AS_DeleteMediaSynthesizer ( void  )

Deactivate audio synthesizer.

Return values
true: success
false: failure

◆ AS_ReleaseMediaSynthesizer()

bool AS_ReleaseMediaSynthesizer ( bool  is_end)

Deactivate audio synthesizer.

Parameters
[in]is_end: All PCM data can be discarded
Return values
true: success
false: failure