<*+ CSTDLIB  *>
<*- NOHEADER *>
<*+ M2EXTENSIONS *>
DEFINITION MODULE ["C"] soundctl;

PROCEDURE samplesize(fd:INTEGER; bits:CARDINAL):INTEGER;  (* 8, 16 *)
PROCEDURE channels(fd:INTEGER; n:CARDINAL):INTEGER;       (* 1, 2  *)
PROCEDURE sampelrate(fd:INTEGER; f:CARDINAL):INTEGER;     (* 8000..48000 *)
PROCEDURE setfragment(fd:INTEGER; f:CARDINAL):INTEGER;    (* 2^buffersize + 65536*buffcount*)
PROCEDURE pcmsync(fd:INTEGER);                            (* flush data before change parameters *)
PROCEDURE getoutfilled(fd:INTEGER):INTEGER;               (* bytes in outbuffer *)
PROCEDURE getsampelrate(fd:INTEGER):CARDINAL;             (* get actual sampelrate *)
PROCEDURE getmixer(fd:INTEGER; device:INTEGER):CARDINAL;  (* get mixer setting (right*256+left) *)
PROCEDURE setmixer(fd:INTEGER; device, value:CARDINAL);          (* set mixer setting (right*256+left) *)
PROCEDURE recnum():CARDINAL;                              (* get mixer record mask channel *)

END soundctl.
(*
Table 14-1: Mixer Channels Name	Description
SOUND_MIXER_VOLUME	master output level
SOUND_MIXER_BASS	bass tone control
SOUND_MIXER_TREBLE	treble tone control
SOUND_MIXER_SYNTH	FM synthesizer
SOUND_MIXER_PCM	D/A converter
SOUND_MIXER_SPEAKER	PC speaker output level
SOUND_MIXER_LINE	line input
SOUND_MIXER_MIC	microphone input
SOUND_MIXER_CD	audio CD input
SOUND_MIXER_IMIX	playback volume from recording source
SOUND_MIXER_ALTPCM	secondary D/A converter
SOUND_MIXER_RECLEV	master recording level
SOUND_MIXER_IGAIN	input gain level
SOUND_MIXER_OGAIN	output gain level
SOUND_MIXER_LINE1	card-specific input #1
SOUND_MIXER_LINE2	card-specific input #2
SOUND_MIXER_LINE3	card-specific input #3
*)