blob: 5655be66a946b95a60ca484fc563b39710ffbf6e [file] [log] [blame]
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00001\section{Built-in Module \sectcode{al}}
Guido van Rossume47da0a1997-07-17 16:34:52 +00002\label{module-al}
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00003\bimodindex{al}
4
Guido van Rossum470be141995-03-17 16:07:09 +00005This module provides access to the audio facilities of the SGI Indy
6and Indigo workstations. See section 3A of the IRIX man pages for
7details. You'll need to read those man pages to understand what these
8functions do! Some of the functions are not available in IRIX
9releases before 4.0.5. Again, see the manual to check whether a
10specific function is available on your platform.
11
12All functions and methods defined in this module are equivalent to
13the C functions with \samp{AL} prefixed to their name.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000014
15Symbolic constants from the C header file \file{<audio.h>} are defined
16in the standard module \code{AL}, see below.
17
18\strong{Warning:} the current version of the audio library may dump core
19when bad argument values are passed rather than returning an error
20status. Unfortunately, since the precise circumstances under which
21this may happen are undocumented and hard to check, the Python
22interface can provide no protection against this kind of problems.
23(One example is specifying an excessive queue size --- there is no
24documented upper limit.)
25
Guido van Rossum470be141995-03-17 16:07:09 +000026The module defines the following functions:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000027
28\renewcommand{\indexsubitem}{(in module al)}
Guido van Rossum470be141995-03-17 16:07:09 +000029
Guido van Rossum16d6e711994-08-08 12:30:22 +000030\begin{funcdesc}{openport}{name\, direction\optional{\, config}}
Guido van Rossum470be141995-03-17 16:07:09 +000031The name and direction arguments are strings. The optional config
32argument is a configuration object as returned by
33\code{al.newconfig()}. The return value is an \dfn{port object};
34methods of port objects are described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000035\end{funcdesc}
36
37\begin{funcdesc}{newconfig}{}
Guido van Rossum470be141995-03-17 16:07:09 +000038The return value is a new \dfn{configuration object}; methods of
39configuration objects are described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000040\end{funcdesc}
41
42\begin{funcdesc}{queryparams}{device}
Guido van Rossum470be141995-03-17 16:07:09 +000043The device argument is an integer. The return value is a list of
44integers containing the data returned by ALqueryparams().
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000045\end{funcdesc}
46
47\begin{funcdesc}{getparams}{device\, list}
Guido van Rossum470be141995-03-17 16:07:09 +000048The device argument is an integer. The list argument is a list such
49as returned by \code{queryparams}; it is modified in place (!).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000050\end{funcdesc}
51
52\begin{funcdesc}{setparams}{device\, list}
Guido van Rossum470be141995-03-17 16:07:09 +000053The device argument is an integer. The list argument is a list such
54as returned by \code{al.queryparams}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000055\end{funcdesc}
56
Guido van Rossum470be141995-03-17 16:07:09 +000057\subsection{Configuration Objects}
58
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000059Configuration objects (returned by \code{al.newconfig()} have the
60following methods:
61
62\renewcommand{\indexsubitem}{(audio configuration object method)}
Guido van Rossum470be141995-03-17 16:07:09 +000063
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000064\begin{funcdesc}{getqueuesize}{}
Guido van Rossum470be141995-03-17 16:07:09 +000065Return the queue size.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000066\end{funcdesc}
67
68\begin{funcdesc}{setqueuesize}{size}
Guido van Rossum470be141995-03-17 16:07:09 +000069Set the queue size.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000070\end{funcdesc}
71
72\begin{funcdesc}{getwidth}{}
Guido van Rossum470be141995-03-17 16:07:09 +000073Get the sample width.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000074\end{funcdesc}
75
Guido van Rossum470be141995-03-17 16:07:09 +000076\begin{funcdesc}{setwidth}{width}
77Set the sample width.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000078\end{funcdesc}
79
80\begin{funcdesc}{getchannels}{}
Guido van Rossum470be141995-03-17 16:07:09 +000081Get the channel count.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000082\end{funcdesc}
83
84\begin{funcdesc}{setchannels}{nchannels}
Guido van Rossum470be141995-03-17 16:07:09 +000085Set the channel count.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000086\end{funcdesc}
87
88\begin{funcdesc}{getsampfmt}{}
Guido van Rossum470be141995-03-17 16:07:09 +000089Get the sample format.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000090\end{funcdesc}
91
92\begin{funcdesc}{setsampfmt}{sampfmt}
Guido van Rossum470be141995-03-17 16:07:09 +000093Set the sample format.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000094\end{funcdesc}
95
96\begin{funcdesc}{getfloatmax}{}
Guido van Rossum470be141995-03-17 16:07:09 +000097Get the maximum value for floating sample formats.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000098\end{funcdesc}
99
100\begin{funcdesc}{setfloatmax}{floatmax}
Guido van Rossum470be141995-03-17 16:07:09 +0000101Set the maximum value for floating sample formats.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000102\end{funcdesc}
103
Guido van Rossum470be141995-03-17 16:07:09 +0000104\subsection{Port Objects}
105
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000106Port objects (returned by \code{al.openport()} have the following
107methods:
108
109\renewcommand{\indexsubitem}{(audio port object method)}
Guido van Rossum470be141995-03-17 16:07:09 +0000110
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000111\begin{funcdesc}{closeport}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000112Close the port.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000113\end{funcdesc}
114
115\begin{funcdesc}{getfd}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000116Return the file descriptor as an int.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000117\end{funcdesc}
118
119\begin{funcdesc}{getfilled}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000120Return the number of filled samples.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000121\end{funcdesc}
122
123\begin{funcdesc}{getfillable}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000124Return the number of fillable samples.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000125\end{funcdesc}
126
127\begin{funcdesc}{readsamps}{nsamples}
Guido van Rossum470be141995-03-17 16:07:09 +0000128Read a number of samples from the queue, blocking if necessary.
129Return the data as a string containing the raw data, (e.g., 2 bytes per
130sample in big-endian byte order (high byte, low byte) if you have set
131the sample width to 2 bytes).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000132\end{funcdesc}
133
134\begin{funcdesc}{writesamps}{samples}
Guido van Rossum470be141995-03-17 16:07:09 +0000135Write samples into the queue, blocking if necessary. The samples are
136encoded as described for the \code{readsamps} return value.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000137\end{funcdesc}
138
139\begin{funcdesc}{getfillpoint}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000140Return the `fill point'.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000141\end{funcdesc}
142
143\begin{funcdesc}{setfillpoint}{fillpoint}
Guido van Rossum470be141995-03-17 16:07:09 +0000144Set the `fill point'.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000145\end{funcdesc}
146
147\begin{funcdesc}{getconfig}{}
148Return a configuration object containing the current configuration of
Guido van Rossum470be141995-03-17 16:07:09 +0000149the port.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000150\end{funcdesc}
151
152\begin{funcdesc}{setconfig}{config}
Guido van Rossum470be141995-03-17 16:07:09 +0000153Set the configuration from the argument, a configuration object.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000154\end{funcdesc}
155
156\begin{funcdesc}{getstatus}{list}
Guido van Rossum470be141995-03-17 16:07:09 +0000157Get status information on last error.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000158\end{funcdesc}
159
160\section{Standard Module \sectcode{AL}}
161\nodename{AL (uppercase)}
162\stmodindex{AL}
163
164This module defines symbolic constants needed to use the built-in
165module \code{al} (see above); they are equivalent to those defined in
166the C header file \file{<audio.h>} except that the name prefix
167\samp{AL_} is omitted. Read the module source for a complete list of
168the defined names. Suggested use:
169
170\bcode\begin{verbatim}
171import al
172from AL import *
173\end{verbatim}\ecode