Interface to an audio system. More...

Detailed Description

Interface to an audio system.

The audio interface is used to control sound hardware.

The inteface provides four sets of functionality:

#define PLAYER_AUDIO_DATA_WAV_REC   1
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_DATA_SEQ   2
 Data subtype: seq_data, recorded sequence of notes. More...
 
#define PLAYER_AUDIO_DATA_MIXER_CHANNEL   3
 Data subtype: mixer_channel_data, audio channel levels. More...
 
#define PLAYER_AUDIO_DATA_STATE   4
 Data subtype: state_data, driver state data (eg playing, stopped, ...) More...
 
#define PLAYER_AUDIO_CMD_WAV_PLAY   1
 Command subtype: wav_play_cmd, play a raw data block, in structure player_audio_wav_t. More...
 
#define PLAYER_AUDIO_CMD_WAV_STREAM_REC   2
 Command subtype: wav_stream_rec_cmd, start/stop recording, data will be returned as data blocks. More...
 
#define PLAYER_AUDIO_CMD_SAMPLE_PLAY   3
 Command subtype: sample_play_cmd, play a pre stored audio sample. More...
 
#define PLAYER_AUDIO_CMD_SEQ_PLAY   4
 Command subtype: seq_play_cmd, play a sequence of tones. More...
 
#define PLAYER_AUDIO_CMD_MIXER_CHANNEL   5
 Command subtype: mixer_channel_cmd, audio channel levels. More...
 
#define PLAYER_AUDIO_REQ_WAV_REC   1
 Request subtype: wav_rec_req, record a fixed size data block, in structure player_audio_wav_t. More...
 
#define PLAYER_AUDIO_REQ_SAMPLE_LOAD   2
 Request subtype: sample_load_req, store a sample. More...
 
#define PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE   3
 Request subtype: sample_retrieve_req, retrieve a stored sample. More...
 
#define PLAYER_AUDIO_REQ_SAMPLE_REC   4
 Request subtype: sample_rec_req, record a new sample. More...
 
#define PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST   5
 Request subtype: mixer_channel_list_req, request the list of channels. More...
 
#define PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL   6
 Request subtype: mixer_channel_level_req, request the channel levels. More...
 
#define PLAYER_AUDIO_STATE_STOPPED   0x00
 Driver states.
 
#define PLAYER_AUDIO_STATE_PLAYING   0x01
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_STATE_RECORDING   0x02
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_DESCRIPTION_BITS   0xFF
 Audio formats. More...
 
#define PLAYER_AUDIO_BITS   0x03
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_8BIT   0
 8 bit
 
#define PLAYER_AUDIO_16BIT   1
 16 bit
 
#define PLAYER_AUDIO_24BIT   2
 24 bit
 
#define PLAYER_AUDIO_MONO   0
 Mono.
 
#define PLAYER_AUDIO_STEREO   4
 Stereo.
 
#define PLAYER_AUDIO_FREQ   0x18
 Frequency.
 
#define PLAYER_AUDIO_FREQ_44k   0
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FREQ_11k   8
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FREQ_22k   16
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FREQ_48k   24
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FORMAT_BITS   0xFF00
 AUDIO format.
 
#define PLAYER_AUDIO_FORMAT_NULL   0x0000
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FORMAT_RAW   0x0100
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FORMAT_MP3   0x0200
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FORMAT_OGG   0x0300
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FORMAT_FLAC   0x0400
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_FORMAT_AAC   0x0500
 
 Data subtype:    wav_rec_data, recorded data block
More...
 
#define PLAYER_AUDIO_MIXER_CHANNEL_TYPE_INPUT   1
 Input audio channel.
 
#define PLAYER_AUDIO_MIXER_CHANNEL_TYPE_OUTPUT   2
 Output audio channel.
 
#define PLAYER_AUDIO_MIXER_CHANNEL_TYPE_SPECIAL   4
 Special audio channel.
 
typedef struct player_audio_wav player_audio_wav_t
 Data: Raw audio data. More...
 
typedef struct player_audio_seq_item player_audio_seq_item_t
 Player audio sequence item. More...
 
typedef struct player_audio_seq player_audio_seq_t
 Player audio sequence. More...
 
typedef struct player_audio_mixer_channel player_audio_mixer_channel_t
 Player mixer channel. More...
 
typedef struct player_audio_mixer_channel_list player_audio_mixer_channel_list_t
 Player mixer channels. More...
 
typedef struct player_audio_mixer_channel_detail player_audio_mixer_channel_detail_t
 Player mixer channel detail. More...
 
typedef struct player_audio_mixer_channel_list_detail player_audio_mixer_channel_list_detail_t
 Player mixer channels. More...
 
typedef struct player_audio_sample player_audio_sample_t
 Player audio sample. More...
 
typedef struct player_audio_sample_item player_audio_sample_item_t
 Player audio sample selection. More...
 
typedef struct player_audio_sample_rec_req player_audio_sample_rec_req_t
 Player audio sample record request. More...
 
typedef struct player_audio_state player_audio_state_t
 Player audio driver state. More...
 

Macro Definition Documentation

◆ PLAYER_AUDIO_BITS

#define PLAYER_AUDIO_BITS   0x03

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_CMD_MIXER_CHANNEL

#define PLAYER_AUDIO_CMD_MIXER_CHANNEL   5

Command subtype: mixer_channel_cmd, audio channel levels.

data is a player_audio_mixer_channel_list_t structure

Referenced by Alsa::ProcessMessage().

◆ PLAYER_AUDIO_CMD_SAMPLE_PLAY

#define PLAYER_AUDIO_CMD_SAMPLE_PLAY   3

Command subtype: sample_play_cmd, play a pre stored audio sample.

data is a player_audio_sample_item_t structure

Referenced by Alsa::ProcessMessage(), and P2OS::ProcessMessage().

◆ PLAYER_AUDIO_CMD_SEQ_PLAY

#define PLAYER_AUDIO_CMD_SEQ_PLAY   4

Command subtype: seq_play_cmd, play a sequence of tones.

data is a player_audio_seq_t structure

◆ PLAYER_AUDIO_CMD_WAV_PLAY

#define PLAYER_AUDIO_CMD_WAV_PLAY   1

Command subtype: wav_play_cmd, play a raw data block, in structure player_audio_wav_t.

data is a player_audio_wav_t structure

Referenced by Alsa::ProcessMessage().

◆ PLAYER_AUDIO_CMD_WAV_STREAM_REC

#define PLAYER_AUDIO_CMD_WAV_STREAM_REC   2

Command subtype: wav_stream_rec_cmd, start/stop recording, data will be returned as data blocks.

data is a player_bool_t

Referenced by Alsa::ProcessMessage().

◆ PLAYER_AUDIO_DATA_MIXER_CHANNEL

#define PLAYER_AUDIO_DATA_MIXER_CHANNEL   3

Data subtype: mixer_channel_data, audio channel levels.

data is a player_audio_mixer_channel_list_t structure

◆ PLAYER_AUDIO_DATA_SEQ

#define PLAYER_AUDIO_DATA_SEQ   2

Data subtype: seq_data, recorded sequence of notes.

data is a player_audio_seq_t structure

◆ PLAYER_AUDIO_DATA_STATE

#define PLAYER_AUDIO_DATA_STATE   4

Data subtype: state_data, driver state data (eg playing, stopped, ...)

data is a player_audio_state_t structure

Referenced by Alsa::Main().

◆ PLAYER_AUDIO_DATA_WAV_REC

#define PLAYER_AUDIO_DATA_WAV_REC   1

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_DESCRIPTION_BITS

#define PLAYER_AUDIO_DESCRIPTION_BITS   0xFF

Audio formats.

Raw Audio bit flags

◆ PLAYER_AUDIO_FORMAT_AAC

#define PLAYER_AUDIO_FORMAT_AAC   0x0500

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FORMAT_FLAC

#define PLAYER_AUDIO_FORMAT_FLAC   0x0400

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FORMAT_MP3

#define PLAYER_AUDIO_FORMAT_MP3   0x0200

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FORMAT_NULL

#define PLAYER_AUDIO_FORMAT_NULL   0x0000

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FORMAT_OGG

#define PLAYER_AUDIO_FORMAT_OGG   0x0300

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FORMAT_RAW

#define PLAYER_AUDIO_FORMAT_RAW   0x0100

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FREQ_11k

#define PLAYER_AUDIO_FREQ_11k   8

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FREQ_22k

#define PLAYER_AUDIO_FREQ_22k   16

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FREQ_44k

#define PLAYER_AUDIO_FREQ_44k   0

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_FREQ_48k

#define PLAYER_AUDIO_FREQ_48k   24

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL

#define PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL   6

Request subtype: mixer_channel_level_req, request the channel levels.

data is a player_audio_mixer_channel_list_t structure

Referenced by Alsa::Main(), and Alsa::ProcessMessage().

◆ PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST

#define PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST   5

Request subtype: mixer_channel_list_req, request the list of channels.

data is a player_audio_mixer_channel_list_detail_t structure

Referenced by Alsa::Main(), and Alsa::ProcessMessage().

◆ PLAYER_AUDIO_REQ_SAMPLE_LOAD

#define PLAYER_AUDIO_REQ_SAMPLE_LOAD   2

Request subtype: sample_load_req, store a sample.

data is a player_audio_sample_t structure

Referenced by Alsa::Main(), and Alsa::ProcessMessage().

◆ PLAYER_AUDIO_REQ_SAMPLE_REC

#define PLAYER_AUDIO_REQ_SAMPLE_REC   4

Request subtype: sample_rec_req, record a new sample.

data is a player_audio_sample_item_t structure

Referenced by Alsa::Main(), and Alsa::ProcessMessage().

◆ PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE

#define PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE   3

Request subtype: sample_retrieve_req, retrieve a stored sample.

data is a player_audio_sample_t structure

Referenced by Alsa::Main(), and Alsa::ProcessMessage().

◆ PLAYER_AUDIO_REQ_WAV_REC

#define PLAYER_AUDIO_REQ_WAV_REC   1

Request subtype: wav_rec_req, record a fixed size data block, in structure player_audio_wav_t.

data is a player_audio_wav_t structure

◆ PLAYER_AUDIO_STATE_PLAYING

#define PLAYER_AUDIO_STATE_PLAYING   0x01

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

Referenced by Alsa::Main().

◆ PLAYER_AUDIO_STATE_RECORDING

#define PLAYER_AUDIO_STATE_RECORDING   0x02

 Data subtype:    wav_rec_data, recorded data block

data is a player_audio_wav_t structure

Referenced by Alsa::Main().

Typedef Documentation

◆ player_audio_mixer_channel_detail_t

Player mixer channel detail.

Describes the state of a mixer channel

◆ player_audio_mixer_channel_list_detail_t

Player mixer channels.

Describes the state of a set of mixer channels details

◆ player_audio_mixer_channel_list_t

Player mixer channels.

Describes the state of a set of mixer channels

◆ player_audio_mixer_channel_t

Player mixer channel.

Describes the state of a mixer channel

◆ player_audio_sample_item_t

Player audio sample selection.

Describes a pre-stored audio sample index

◆ player_audio_sample_rec_req_t

Player audio sample record request.

Request to record a sample and store it locally.

◆ player_audio_sample_t

Player audio sample.

Describes an audio sample, if the index is set to -1 the next available slot is used and the index is returned in the response.

◆ player_audio_seq_item_t

Player audio sequence item.

This describes a single sequence element, the link field is used for chord type playback when a series of notes are to be played together. Set link to true for all but the last notes to be player together.

◆ player_audio_seq_t

Player audio sequence.

Describes a sequence of notes to be played or which have been recieved

◆ player_audio_state_t

Player audio driver state.

Describes the current state of the audio driver. Usually only sent when state changes.

◆ player_audio_wav_t

Data: Raw audio data.

This data is used in the PLAYER_AUDIO_CMD_WAV_PLAY, and returned as PLAYER_AUDIO_DATA_WAV_REC when stream recording is enabled