blob: 6a812ddab085aded2df74809d2ae4b833013ee2b [file] [log] [blame]
Guido van Rossum5fdeeea1994-01-02 01:22:07 +00001\section{Built-in Module \sectcode{al}}
2\bimodindex{al}
3
Guido van Rossum470be141995-03-17 16:07:09 +00004This module provides access to the audio facilities of the SGI Indy
5and Indigo workstations. See section 3A of the IRIX man pages for
6details. You'll need to read those man pages to understand what these
7functions do! Some of the functions are not available in IRIX
8releases before 4.0.5. Again, see the manual to check whether a
9specific function is available on your platform.
10
11All functions and methods defined in this module are equivalent to
12the C functions with \samp{AL} prefixed to their name.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000013
14Symbolic constants from the C header file \file{<audio.h>} are defined
15in the standard module \code{AL}, see below.
16
17\strong{Warning:} the current version of the audio library may dump core
18when bad argument values are passed rather than returning an error
19status. Unfortunately, since the precise circumstances under which
20this may happen are undocumented and hard to check, the Python
21interface can provide no protection against this kind of problems.
22(One example is specifying an excessive queue size --- there is no
23documented upper limit.)
24
Guido van Rossum470be141995-03-17 16:07:09 +000025The module defines the following functions:
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000026
27\renewcommand{\indexsubitem}{(in module al)}
Guido van Rossum470be141995-03-17 16:07:09 +000028
Guido van Rossum16d6e711994-08-08 12:30:22 +000029\begin{funcdesc}{openport}{name\, direction\optional{\, config}}
Guido van Rossum470be141995-03-17 16:07:09 +000030The name and direction arguments are strings. The optional config
31argument is a configuration object as returned by
32\code{al.newconfig()}. The return value is an \dfn{port object};
33methods of port objects are described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000034\end{funcdesc}
35
36\begin{funcdesc}{newconfig}{}
Guido van Rossum470be141995-03-17 16:07:09 +000037The return value is a new \dfn{configuration object}; methods of
38configuration objects are described below.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000039\end{funcdesc}
40
41\begin{funcdesc}{queryparams}{device}
Guido van Rossum470be141995-03-17 16:07:09 +000042The device argument is an integer. The return value is a list of
43integers containing the data returned by ALqueryparams().
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000044\end{funcdesc}
45
46\begin{funcdesc}{getparams}{device\, list}
Guido van Rossum470be141995-03-17 16:07:09 +000047The device argument is an integer. The list argument is a list such
48as returned by \code{queryparams}; it is modified in place (!).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000049\end{funcdesc}
50
51\begin{funcdesc}{setparams}{device\, list}
Guido van Rossum470be141995-03-17 16:07:09 +000052The device argument is an integer. The list argument is a list such
53as returned by \code{al.queryparams}.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000054\end{funcdesc}
55
Guido van Rossum470be141995-03-17 16:07:09 +000056\subsection{Configuration Objects}
57
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000058Configuration objects (returned by \code{al.newconfig()} have the
59following methods:
60
61\renewcommand{\indexsubitem}{(audio configuration object method)}
Guido van Rossum470be141995-03-17 16:07:09 +000062
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000063\begin{funcdesc}{getqueuesize}{}
Guido van Rossum470be141995-03-17 16:07:09 +000064Return the queue size.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000065\end{funcdesc}
66
67\begin{funcdesc}{setqueuesize}{size}
Guido van Rossum470be141995-03-17 16:07:09 +000068Set the queue size.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000069\end{funcdesc}
70
71\begin{funcdesc}{getwidth}{}
Guido van Rossum470be141995-03-17 16:07:09 +000072Get the sample width.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000073\end{funcdesc}
74
Guido van Rossum470be141995-03-17 16:07:09 +000075\begin{funcdesc}{setwidth}{width}
76Set the sample width.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000077\end{funcdesc}
78
79\begin{funcdesc}{getchannels}{}
Guido van Rossum470be141995-03-17 16:07:09 +000080Get the channel count.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000081\end{funcdesc}
82
83\begin{funcdesc}{setchannels}{nchannels}
Guido van Rossum470be141995-03-17 16:07:09 +000084Set the channel count.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000085\end{funcdesc}
86
87\begin{funcdesc}{getsampfmt}{}
Guido van Rossum470be141995-03-17 16:07:09 +000088Get the sample format.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000089\end{funcdesc}
90
91\begin{funcdesc}{setsampfmt}{sampfmt}
Guido van Rossum470be141995-03-17 16:07:09 +000092Set the sample format.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000093\end{funcdesc}
94
95\begin{funcdesc}{getfloatmax}{}
Guido van Rossum470be141995-03-17 16:07:09 +000096Get the maximum value for floating sample formats.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +000097\end{funcdesc}
98
99\begin{funcdesc}{setfloatmax}{floatmax}
Guido van Rossum470be141995-03-17 16:07:09 +0000100Set the maximum value for floating sample formats.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000101\end{funcdesc}
102
Guido van Rossum470be141995-03-17 16:07:09 +0000103\subsection{Port Objects}
104
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000105Port objects (returned by \code{al.openport()} have the following
106methods:
107
108\renewcommand{\indexsubitem}{(audio port object method)}
Guido van Rossum470be141995-03-17 16:07:09 +0000109
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000110\begin{funcdesc}{closeport}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000111Close the port.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000112\end{funcdesc}
113
114\begin{funcdesc}{getfd}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000115Return the file descriptor as an int.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000116\end{funcdesc}
117
118\begin{funcdesc}{getfilled}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000119Return the number of filled samples.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000120\end{funcdesc}
121
122\begin{funcdesc}{getfillable}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000123Return the number of fillable samples.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000124\end{funcdesc}
125
126\begin{funcdesc}{readsamps}{nsamples}
Guido van Rossum470be141995-03-17 16:07:09 +0000127Read a number of samples from the queue, blocking if necessary.
128Return the data as a string containing the raw data, (e.g., 2 bytes per
129sample in big-endian byte order (high byte, low byte) if you have set
130the sample width to 2 bytes).
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000131\end{funcdesc}
132
133\begin{funcdesc}{writesamps}{samples}
Guido van Rossum470be141995-03-17 16:07:09 +0000134Write samples into the queue, blocking if necessary. The samples are
135encoded as described for the \code{readsamps} return value.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000136\end{funcdesc}
137
138\begin{funcdesc}{getfillpoint}{}
Guido van Rossum470be141995-03-17 16:07:09 +0000139Return the `fill point'.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000140\end{funcdesc}
141
142\begin{funcdesc}{setfillpoint}{fillpoint}
Guido van Rossum470be141995-03-17 16:07:09 +0000143Set the `fill point'.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000144\end{funcdesc}
145
146\begin{funcdesc}{getconfig}{}
147Return a configuration object containing the current configuration of
Guido van Rossum470be141995-03-17 16:07:09 +0000148the port.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000149\end{funcdesc}
150
151\begin{funcdesc}{setconfig}{config}
Guido van Rossum470be141995-03-17 16:07:09 +0000152Set the configuration from the argument, a configuration object.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000153\end{funcdesc}
154
155\begin{funcdesc}{getstatus}{list}
Guido van Rossum470be141995-03-17 16:07:09 +0000156Get status information on last error.
Guido van Rossum5fdeeea1994-01-02 01:22:07 +0000157\end{funcdesc}
158
159\section{Standard Module \sectcode{AL}}
160\nodename{AL (uppercase)}
161\stmodindex{AL}
162
163This module defines symbolic constants needed to use the built-in
164module \code{al} (see above); they are equivalent to those defined in
165the C header file \file{<audio.h>} except that the name prefix
166\samp{AL_} is omitted. Read the module source for a complete list of
167the defined names. Suggested use:
168
169\bcode\begin{verbatim}
170import al
171from AL import *
172\end{verbatim}\ecode