Developer World
Spresense SDK Library v1.4.0-aa7f53a
audio_player_api.h File Reference

CXD5602 Audio Player API. More...

#include <stdint.h>
#include <stdbool.h>
#include "audio/audio_common_defs.h"
#include "audio/audio_object_common_api.h"
#include "memutils/memory_manager/MemHandle.h"
#include "memutils/message/MsgPacket.h"

Go to the source code of this file.

Classes

struct  AsPlayerInputDeviceHdlrForRAM
 
struct  AsActivatePlayerParam
 
struct  AsActivatePlayer
 
struct  SetPlayerStsParam
 
struct  AsDeactivatePlayer
 
struct  AsInitPlayerParam
 
union  AsPcmDataDest
 
struct  AsPcmDataDest::__st_pcm_msg
 [in] Decoded PCM notify message More...
 
struct  AsPlayPlayerParam
 
struct  AsStopPlayerParam
 
struct  AsSetGainParam
 
struct  AsRequestNextParam
 
struct  PlayerCommand
 
struct  AsPlayerMsgQueId_t
 
struct  AsPlayerPoolId_t
 
struct  AsPlayerPoolId_old_t
 
struct  AsCreatePlayerParam_t
 
struct  AsCreatePlayerParams_t
 

Macros

#define AS_FEATURE_PLAYER_ENABLE
 
#define AS_FEATURE_OUTPUTMIX_ENABLE
 
Packet length of player command
#define LENGTH_INIT_PLAYER   (9)
 InitPlayer command (AUDCMD_INITPLAYER) packet length.
 
#define LENGTH_INIT_SUBPLAYER   (LENGTH_INIT_PLAYER)
 InitSubPlayer command (#AUDCMD_INITSUBPLAYER) packet length.
 
#define LENGTH_PLAY_PLAYER   (2)
 PlayPlayer command (AUDCMD_PLAYPLAYER) packet length.
 
#define LENGTH_PLAY_SUBPLAYER   (LENGTH_PLAY_PLAYER)
 PlaySubPlayer command (#AUDCMD_PLAYSUBPLAYER) packet length.
 
#define LENGTH_STOP_PLAYER   (2)
 StopPlayer command (AUDCMD_STOPPLAYER) packet length.
 
#define LENGTH_STOP_SUBPLAYER   (LENGTH_STOP_PLAYER)
 StopSubPlayer command (#AUDCMD_STOPSUBPLAYER) packet length.
 
#define LENGTH_CLK_RECOVERY   (2)
 ClkRecovery command ("AUDCMD_CLKRECOVERY)packet length.
 
#define LENGTH_SET_GAIN   (2)
 Set audio gain leve command ("AUDCMD_SETGAIN)packet length.
 
#define LENGTH_SENDPOSTCMD   (10)
 Send Pfcommand command ("AUDCMD_SENDPOSTCMD") packet length.
 

Typedefs

typedef void(* AudioSimpleFifoReadDoneCallbackFunction) (uint32_t size)
 
typedef bool(* MediaPlayerCallback) (AsPlayerEvent evtype, uint32_t result, uint32_t sub_result)
 
typedef void(* DecodeDoneCallback) (AsPcmDataParam param)
 

Enumerations

enum  AsPlayerEvent {
  AsPlayerEventAct = 0, AsPlayerEventInit, AsPlayerEventPlay, AsPlayerEventStop,
  AsPlayerEventDeact, AsPlayerEventSetGain
}
 
enum  AsPlayerId { AS_PLAYER_ID_0 = 0, AS_PLAYER_ID_1 }
 
enum  AsSetActivatePlayer { AS_ACTPLAYER_MAIN = 1, AS_ACTPLAYER_SUB, AS_ACTPLAYER_BOTH, AS_ACTPLAYER_NUM }
 
enum  AsSetPlayerInputDevice {
  AS_SETPLAYER_INPUTDEVICE_EMMC = 0, AS_SETPLAYER_INPUTDEVICE_A2DPFIFO, AS_SETPLAYER_INPUTDEVICE_I2SINPUT, AS_SETPLAYER_INPUTDEVICE_RAM,
  AS_SETPLAYER_INPUTDEVICE_NUM
}
 
enum  AsSetPlayerOutputDevice { AS_SETPLAYER_OUTPUTDEVICE_SPHP = 0, AS_SETPLAYER_OUTPUTDEVICE_I2SOUTPUT, AS_SETPLAYER_OUTPUTDEVICE_A2DPFIFO, AS_SETPLAYER_OUTPUTDEVICE_NUM }
 
enum  AsStopPlayerStopMode { AS_STOPPLAYER_NORMAL = 0, AS_STOPPLAYER_ESEND, AS_STOPPLAYER_FORCIBLY = 0xFF }
 
enum  AsClkRecoveryDirection { OutputMixAdvance = -1, OutputMixNoAdjust = 0, OutputMixDelay = 1 }
 
enum  AsPcmDataPath { AsPcmDataReply = 0, AsPcmDataTunnel }
 
enum  AsRequestNextType { AsNextNormalRequest = 0, AsNextStopResRequest }
 

Functions

bool AS_CreatePlayer (AsPlayerId id, FAR AsCreatePlayerParam_t *param)
 Create audio main player. More...
 
bool AS_CreatePlayerMulti (AsPlayerId id, FAR AsCreatePlayerParam_t *param, AudioAttentionCb attcb)
 Create audio main player using memory pool in work area of src. More...
 
bool AS_CreatePlayerMulti (AsPlayerId id, FAR AsCreatePlayerParams_t *param, AudioAttentionCb attcb)
 
 __attribute__ ((deprecated("\\ \Deprecated create API is used. \ \Use \S_CreatePlayerMulti(AsPlayerId, \ \ AsCreatePlayerParam_t *, \ \ AudioAttentionCb)\ \ \\ \))) bool AS_CreatePlayerMulti(AsPlayerId id
 
bool AS_CreatePlayerMulti (AsPlayerId id, FAR AsCreatePlayerParams_t *param)
 
bool AS_ActivatePlayer (AsPlayerId id, FAR AsActivatePlayer *actparam)
 Activate audio (sub)player. More...
 
bool AS_InitPlayer (AsPlayerId id, FAR AsInitPlayerParam *initparam)
 Initialize audio (sub)player. More...
 
bool AS_PlayPlayer (AsPlayerId id, FAR AsPlayPlayerParam *playparam)
 Play audio (sub)player. More...
 
bool AS_StopPlayer (AsPlayerId id, FAR AsStopPlayerParam *stopparam)
 Stop audio (sub)player. More...
 
bool AS_SetPlayerGain (AsPlayerId id, FAR AsSetGainParam *gainparam)
 Set audio gain level of (sub)player. More...
 
bool AS_RequestNextPlayerProcess (AsPlayerId id, FAR AsRequestNextParam *nextparam)
 Request next process(decode) to (sub)player. More...
 
bool AS_DeactivatePlayer (AsPlayerId id, FAR AsDeactivatePlayer *deactparam)
 Deactivate (sub)player. More...
 
bool AS_DeletePlayer (AsPlayerId id)
 Deactivate audio main player. More...
 
bool AS_checkAvailabilityMediaPlayer (AsPlayerId id)
 Check availability of MediaPlayer. More...
 

Variables

FAR AsCreatePlayerParam_tparam
 

Detailed Description

CXD5602 Audio Player API.

Author
CXD5602 Audio SW Team