audiodsp
[Interface specifications]


Detailed Description

Audible tone emission / detectionThe audiodsp interface is used to control sound hardware, if equipped.

#define PLAYER_AUDIODSP_MAX_FREQS   8
#define PLAYER_AUDIODSP_MAX_BITSTRING_LEN   64
 Maximum length of a BPSK bitstring to emit.
#define PLAYER_AUDIODSP_SET_CONFIG   1
 Request/reply subtype: set configuration.
#define PLAYER_AUDIODSP_GET_CONFIG   2
 Request/reply subtype: get configuration.
#define PLAYER_AUDIODSP_PLAY_TONE   1
 Command subtype: play tone.
#define PLAYER_AUDIODSP_PLAY_CHIRP   2
 Command subtype: play chirp.
#define PLAYER_AUDIODSP_REPLAY   3
 Command subtype: replay (last tone, last chirp ?).
#define PLAYER_AUDIODSP_DATA_TONES   1
 Data subtype: detected tones.
typedef struct
player_audiodsp_data 
player_audiodsp_data_t
typedef struct
player_audiodsp_cmd 
player_audiodsp_cmd_t
typedef struct
player_audiodsp_config 
player_audiodsp_config_t

Define Documentation

#define PLAYER_AUDIODSP_MAX_FREQS   8

Maximum number of frequencies to report


Typedef Documentation

Command: tone / chirp to playThe audiodsp interface accepts commands to produce fixed-frequency tones or binary phase shift keyed(BPSK) chirps through /dev/dsp (which is assumed to be associated with a sound card to which a speaker is attached). The command subtype, which should be PLAYER_AUDIODSP_PLAY_TONE, PLAYER_AUDIODSP_PLAY_CHIRP, or PLAYER_AUDIODSP_REPLAY, determines what to do.

Request/reply : Get/set audio properties.

Send a null PLAYER_AUDIODSP_GET_CONFIG request to receive the audiodsp configuration. Send a full PLAYER_AUDIODSP_SET_CONFIG request to modify the configuration (and receive a null response).

The sample format is defined in sys/soundcard.h, and defines the byte size and endian format for each sample.

The sample rate defines the Hertz at which to sample.

Mono or stereo sampling is defined in the channels parameter where 1==mono and 2==stereo.

Data: detected tones (PLAYER_AUDIODSP_DATA_TONES)The audiodsp interface reads the audio stream from /dev/dsp (which is assumed to be associated with a sound card connected to a microphone) and performs some analysis on it. PLAYER_AUDIODSP_MAX_FREQS number of frequency/amplitude pairs are then returned as data.


Last updated 12 September 2005 21:38:45