source: vendor/python/2.5/Doc/lib/libal.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 5.6 KB
Line 
1\section{\module{al} ---
2 Audio functions on the SGI}
3
4\declaremodule{builtin}{al}
5 \platform{IRIX}
6\modulesynopsis{Audio functions on the SGI.}
7
8
9This module provides access to the audio facilities of the SGI Indy
10and Indigo workstations. See section 3A of the IRIX man pages for
11details. You'll need to read those man pages to understand what these
12functions do! Some of the functions are not available in IRIX
13releases before 4.0.5. Again, see the manual to check whether a
14specific function is available on your platform.
15
16All functions and methods defined in this module are equivalent to
17the C functions with \samp{AL} prefixed to their name.
18
19Symbolic constants from the C header file \code{<audio.h>} are
20defined in the standard module
21\refmodule[al-constants]{AL}\refstmodindex{AL}, see below.
22
23\warning{The current version of the audio library may dump core
24when bad argument values are passed rather than returning an error
25status. Unfortunately, since the precise circumstances under which
26this may happen are undocumented and hard to check, the Python
27interface can provide no protection against this kind of problems.
28(One example is specifying an excessive queue size --- there is no
29documented upper limit.)}
30
31The module defines the following functions:
32
33
34\begin{funcdesc}{openport}{name, direction\optional{, config}}
35The name and direction arguments are strings. The optional
36\var{config} argument is a configuration object as returned by
37\function{newconfig()}. The return value is an \dfn{audio port
38object}; methods of audio port objects are described below.
39\end{funcdesc}
40
41\begin{funcdesc}{newconfig}{}
42The return value is a new \dfn{audio configuration object}; methods of
43audio configuration objects are described below.
44\end{funcdesc}
45
46\begin{funcdesc}{queryparams}{device}
47The device argument is an integer. The return value is a list of
48integers containing the data returned by \cfunction{ALqueryparams()}.
49\end{funcdesc}
50
51\begin{funcdesc}{getparams}{device, list}
52The \var{device} argument is an integer. The list argument is a list
53such as returned by \function{queryparams()}; it is modified in place
54(!).
55\end{funcdesc}
56
57\begin{funcdesc}{setparams}{device, list}
58The \var{device} argument is an integer. The \var{list} argument is a
59list such as returned by \function{queryparams()}.
60\end{funcdesc}
61
62
63\subsection{Configuration Objects \label{al-config-objects}}
64
65Configuration objects returned by \function{newconfig()} have the
66following methods:
67
68\begin{methoddesc}[audio configuration]{getqueuesize}{}
69Return the queue size.
70\end{methoddesc}
71
72\begin{methoddesc}[audio configuration]{setqueuesize}{size}
73Set the queue size.
74\end{methoddesc}
75
76\begin{methoddesc}[audio configuration]{getwidth}{}
77Get the sample width.
78\end{methoddesc}
79
80\begin{methoddesc}[audio configuration]{setwidth}{width}
81Set the sample width.
82\end{methoddesc}
83
84\begin{methoddesc}[audio configuration]{getchannels}{}
85Get the channel count.
86\end{methoddesc}
87
88\begin{methoddesc}[audio configuration]{setchannels}{nchannels}
89Set the channel count.
90\end{methoddesc}
91
92\begin{methoddesc}[audio configuration]{getsampfmt}{}
93Get the sample format.
94\end{methoddesc}
95
96\begin{methoddesc}[audio configuration]{setsampfmt}{sampfmt}
97Set the sample format.
98\end{methoddesc}
99
100\begin{methoddesc}[audio configuration]{getfloatmax}{}
101Get the maximum value for floating sample formats.
102\end{methoddesc}
103
104\begin{methoddesc}[audio configuration]{setfloatmax}{floatmax}
105Set the maximum value for floating sample formats.
106\end{methoddesc}
107
108
109\subsection{Port Objects \label{al-port-objects}}
110
111Port objects, as returned by \function{openport()}, have the following
112methods:
113
114\begin{methoddesc}[audio port]{closeport}{}
115Close the port.
116\end{methoddesc}
117
118\begin{methoddesc}[audio port]{getfd}{}
119Return the file descriptor as an int.
120\end{methoddesc}
121
122\begin{methoddesc}[audio port]{getfilled}{}
123Return the number of filled samples.
124\end{methoddesc}
125
126\begin{methoddesc}[audio port]{getfillable}{}
127Return the number of fillable samples.
128\end{methoddesc}
129
130\begin{methoddesc}[audio port]{readsamps}{nsamples}
131Read a number of samples from the queue, blocking if necessary.
132Return the data as a string containing the raw data, (e.g., 2 bytes per
133sample in big-endian byte order (high byte, low byte) if you have set
134the sample width to 2 bytes).
135\end{methoddesc}
136
137\begin{methoddesc}[audio port]{writesamps}{samples}
138Write samples into the queue, blocking if necessary. The samples are
139encoded as described for the \method{readsamps()} return value.
140\end{methoddesc}
141
142\begin{methoddesc}[audio port]{getfillpoint}{}
143Return the `fill point'.
144\end{methoddesc}
145
146\begin{methoddesc}[audio port]{setfillpoint}{fillpoint}
147Set the `fill point'.
148\end{methoddesc}
149
150\begin{methoddesc}[audio port]{getconfig}{}
151Return a configuration object containing the current configuration of
152the port.
153\end{methoddesc}
154
155\begin{methoddesc}[audio port]{setconfig}{config}
156Set the configuration from the argument, a configuration object.
157\end{methoddesc}
158
159\begin{methoddesc}[audio port]{getstatus}{list}
160Get status information on last error.
161\end{methoddesc}
162
163
164\section{\module{AL} ---
165 Constants used with the \module{al} module}
166
167\declaremodule[al-constants]{standard}{AL}
168 \platform{IRIX}
169\modulesynopsis{Constants used with the \module{al} module.}
170
171
172This module defines symbolic constants needed to use the built-in
173module \refmodule{al} (see above); they are equivalent to those defined
174in the C header file \code{<audio.h>} except that the name prefix
175\samp{AL_} is omitted. Read the module source for a complete list of
176the defined names. Suggested use:
177
178\begin{verbatim}
179import al
180from AL import *
181\end{verbatim}
Note: See TracBrowser for help on using the repository browser.