Availability: Linux, FreeBSD.
New in version 2.3.
This module allows you to access the OSS (Open Sound System) audio interface. OSS is available for a wide range of open-source and commercial Unices, and is the standard audio interface for Linux and recent versions of FreeBSD.
The module defines a large number of constants supplied by
the OSS device driver; see
<sys/soundcard.h> on either
Linux or FreeBSD for a listing .
ossaudiodev defines the following variables and functions:
(If ossaudiodev receives an error from a system call such as open(), write(), or ioctl(), it raises IOError. Errors detected directly by ossaudiodev result in OSSAudioError.)
(For backwards compatibility, the exception class is also available as
device is the audio device filename to use. If it is not specified, this module first looks in the environment variable AUDIODEV for a device to use. If not found, it falls back to /dev/dsp.
mode is one of
'r' for read-only (record) access,
'w' for write-only (playback) access and
'rw' for both.
Since many sound cards only allow one process to have the recorder or
player open at a time, it is a good idea to open the device only for the
activity needed. Further, some sound cards are half-duplex: they can be
opened for reading or writing, but not both at once.
Note the unusual calling syntax: the first argument is optional, and the second is required. This is a historical artifact for compatibility with the older linuxaudiodev module which ossaudiodev supersedes.