Commit f882c77d authored by Greg Ward's avatar Greg Ward

Expand description of ossaudiodev.error exception.

Improve descriptions of open(), openmixer().
parent 3e34f59c
...@@ -24,33 +24,54 @@ kernel 2.4) and FreeBSD. ...@@ -24,33 +24,54 @@ kernel 2.4) and FreeBSD.
\module{ossaudiodev} defines the following variables and functions: \module{ossaudiodev} defines the following variables and functions:
\begin{excdesc}{error} \begin{excdesc}{error}
This exception is raised on errors. The argument is a string describing This exception is raised on certain errors. The argument is a string
what went wrong. describing what went wrong.
(If \module{ossaudiodev} receives an error from a system call such as
\cfunction{open()}, \cfunction{write()}, or \cfunction{ioctl()}, it
raises \exception{IOError}. Errors detected directly by
\module{ossaudiodev} result in \exception{ossaudiodev.error}.)
\end{excdesc} \end{excdesc}
\begin{funcdesc}{open}{\optional{device, }mode} \begin{funcdesc}{open}{\optional{device, }mode}
This function opens the audio device and returns an OSS audio device Open an audio device and return an OSS audio device object. This
object. This object can then be used to do I/O on. The \var{device} object supports many file-like methods, such as \method{read()},
parameter is the audio device filename to use. If it is not specified, \method{write()}, and \method{fileno()} (although there are subtle
this module first looks in the environment variable \envvar{AUDIODEV} for differences between conventional Unix read/write semantics and those of
a device to use. If not found, it falls back to \file{/dev/dsp}. OSS audio devices). It also supports a number of audio-specific
methods; see below for the complete list of methods.
The \var{mode} parameter is one of \code{'r'} for record-only access,
\code{'w'} for play-only access and \code{'rw'} for both. Since many Note the unusual calling syntax: the \emph{first} argument is optional,
soundcards only allow one process to have the recorder or player open at and the second is required. This is a historical artifact for
a time it is a good idea to open the device only for the activity compatibility with the older \module{linuxaudiodev} module which
needed. Further, some soundcards are half-duplex: they can be opened \module{ossaudiodev} supersedes. % XXX it might also be motivated
for reading or writing, but not both at once. % by my unfounded-but-still-possibly-true belief that the default
% audio device varies unpredictably across operating systems. -GW
\var{device} is the audio device filename to use. If it is not
specified, this module first looks in the environment variable
\envvar{AUDIODEV} for a device to use. If not found, it falls back to
\file{/dev/dsp}.
\var{mode} is one of \code{'r'} for read-only (record) access,
\code{'w'} for write-only (playback) access and \code{'rw'} for both.
Since many soundcards 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 soundcards are half-duplex: they can be
opened for reading or writing, but not both at once.
\end{funcdesc} \end{funcdesc}
\begin{funcdesc}{openmixer}{\optional{device\optional{, mode}}} This function \begin{funcdesc}{openmixer}{\optional{device\optional{, mode}}}
opens the mixer device and returns an OSS mixer device object. The Open a mixer device and return an OSS mixer device object.
\var{device} parameter is the mixer device filename to use. If it is \var{device} is the mixer device filename to use. If it is
not specified, this module first looks in the environment variable not specified, this module first looks in the environment variable
\envvar{MIXERDEV} for a device to use. If not found, it falls back to \envvar{MIXERDEV} for a device to use. If not found, it falls back to
\file{/dev/mixer}. You may specify \code{'r'}, \code{'rw'} or \file{/dev/mixer}. You may specify \code{'r'}, \code{'rw'} or
\code{'w'} for \var{mode}; the default is \code{'r'}. \code{'w'} for \var{mode}; the default is \code{'r'}.
% XXX I suspect 'mode' is irrelevant, ie. that OSS doesn't care.
% If so this argument and the code that handles it should be ripped out.
\end{funcdesc} \end{funcdesc}
\subsection{Audio Device Objects \label{ossaudio-device-objects}} \subsection{Audio Device Objects \label{ossaudio-device-objects}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment