Technical data
audio(7I) Ioctl Requests SunOS 5.5
uint_t samples; /∗ number of samples converted ∗/
uint_t eof; /∗ End Of File counter (play only) ∗/
uchar_t pause; /∗ non-zero if paused, zero to resume ∗/
uchar_t error; /∗ non-zero if overflow/underflow ∗/
uchar_t waiting; /∗ non-zero if a process wants access ∗/
uchar_t balance; /∗ stereo channel balance ∗/
/∗ The following values are read-only device state flags ∗/
uchar_t open; /∗ non-zero if open access granted ∗/
uchar_t active; /∗ non-zero if I/O active ∗/
uint_t avail_ports; /∗ available I/O ports ∗/
} audio_prinfo_t;
/∗ This structure is used in AUDIO_GETINFO and AUDIO_SETINFO ioctl
commands ∗/
typedef struct audio_info {
audio_prinfo_t record; /∗ input status information ∗/
audio_prinfo_t play; /∗ output status information ∗/
uint_t monitor_gain; /∗ input to output mix ∗/
uchar_t output_muted; /∗ non-zero if output muted ∗/
} audio_info_t;
/∗ Audio encoding types ∗/
#define AUDIO_ENCODING_ULAW (1) /∗ u-law encoding ∗/
#define AUDIO_ENCODING_ALAW (2) /∗ A-law encoding ∗/
#define AUDIO_ENCODING_LINEAR (3) /∗ Linear PCM encoding ∗/
/∗ These ranges apply to record, play, and monitor gain values ∗/
#define AUDIO_MIN_GAIN (0) /∗ minimum gain value ∗/
#define AUDIO_MAX_GAIN (255) /∗ maximum gain value ∗/
/∗ These values apply to the balance field to adjust channel gain values ∗/
#define AUDIO_LEFT_BALANCE (0) /∗ left channel only ∗/
#define AUDIO_MID_BALANCE (32) /∗ equal left/right balance ∗/
#define AUDIO_RIGHT_BALANCE (64) /∗ right channel only ∗/
/∗ Define some convenient audio port names (for port and avail_ports) ∗/
/∗ output ports (several might be enabled at once) ∗/
#define AUDIO_SPEAKER (0x01) /∗ output to built-in speaker ∗/
#define AUDIO_HEADPHONE (0x02) /∗ output to headphone jack ∗/
#define AUDIO_LINE_OUT (0x04) /∗ output to line out ∗/
/∗ input ports (usually only one may be enabled at a time) ∗/
#define AUDIO_MICROPHONE (0x01) /∗ input from microphone ∗/
#define AUDIO_LINE_IN (0x02) /∗ input from line in ∗/
#define MAX_AUDIO_DEV_LEN(16)
/∗ Parameter for the AUDIO_GETDEV ioctl ∗/
typedef struct audio_device {
char name[MAX_AUDIO_DEV_LEN];
char version[MAX_AUDIO_DEV_LEN];
char config[MAX_AUDIO_DEV_LEN];
} audio_device_t;
The play.gain and record.gain fields specify the output and input volume levels. A value of
AUDIO_MAX_GAIN indicates maximum volume. Audio output may also be temporarily
muted by setting a non-zero value in the output_muted field. Clearing this field restores
7I-28 modified 21 Mar 1995










