ALSA audio Isis software documentation

ALSA audio

ALSA is the Advanced Linux Sound Architecture. Isis provides an interface to some of the functionality of ALSA, mainly for playing and recording audio. This low-level interface is described briefly below. More detailed documentation will be added soon. See the ALSA online documentation for more information.

There are also high-level platform-independent audio utilities available. These utilities are easier to use and sufficient for most audio applications. Please consider using them first.

As of February 2003, Isis uses ALSA version 0.9.x. We highly recommend upgrading your version of Isis to take advantage of the improvements in the sound library. You will need to make some small changes to any Isis programs that used the older version of ALSA. Contact Stefan for more information. The documentation below is for systems with ALSA 0.9.x.

(alsa-open-output device) # initialize playback, returns acon (alsa-open-input device) # initialize recording, returns acon # device is OPTIONAL and defaults to "plughw:0,0" (alsa-setup acon bits unsigned-flag big-endian-flag rate channels bufsamps) # sets PCM parameters # bits: 8 or 16 # unsigned-flag: True or False # big-endian-flag: True or False # rate: (integer, usually 11025 22050 44100) # channels: usually 1 or 2 # bufsamps: desired transfer size in * SAMPLES * (not bytes) # returns ACTUAL buffer size in * SAMPLES * to be used # which may be different from that requested. # you can then calculate buffer size in bytes like this: # (set bufbytes (* bufsamps channels (/ bits 8))) (alsa-prepare acon) # prepare to start (alsa-start acon) # start transfer (alsa-pause acon) # pause transfer (alsa-resume acon) # resume transfer (alsa-drop acon) # stop transfer, dropping queued samples (alsa-drain acon) # stop transfer, draining queued samples (alsa-reset acon) # delete queued samples (alsa-state acon) # returns True if playing/capturing # False otherwise (if there was under/overrun) # use alsa-prepare to re-prepare (alsa-read acon numsamps buffer) # read audio data (alsa-write acon numsamps buffer) # write audio data # numsamps must be a multiple of bufsamps (alsa-delay acon) # return distance in samples between # application and device position (alsa-avail acon) # return number of samples ready to be read/written (alsa-link acon1 acon2) # link 2 streams for synchronized start/stop (alsa-unlink acon) # remove a stream from a linked group

Other: Needs ALSA audio library