38.1. al — Audio functions on the SGI

Python v2.7.2

38.1. al — Audio functions on the SGI

Platforms: IRIX

Deprecated since version 2.6: The al module has been deprecated for removal in Python 3.0.

This module provides access to the audio facilities of the SGI Indy and Indigo workstations. See section 3A of the IRIX man pages for details. You’ll need to read those man pages to understand what these functions do! Some of the functions are not available in IRIX releases before 4.0.5. Again, see the manual to check whether a specific function is available on your platform.

All functions and methods defined in this module are equivalent to the C functions with AL prefixed to their name.

Symbolic constants from the C header file <audio.h> are defined in the standard module AL, see below.

Warning

The current version of the audio library may dump core when bad argument values are passed rather than returning an error status. Unfortunately, since the precise circumstances under which this may happen are undocumented and hard to check, the Python interface can provide no protection against this kind of problems. (One example is specifying an excessive queue size — there is no documented upper limit.)

The module defines the following functions:

al.openport(name, direction[, config])
The name and direction arguments are strings. The optional config argument is a configuration object as returned by newconfig(). The return value is an audio port object; methods of audio port objects are described below.
al.newconfig()
The return value is a new audio configuration object; methods of audio configuration objects are described below.
al.queryparams(device)
The device argument is an integer. The return value is a list of integers containing the data returned by ALqueryparams().
al.getparams(device, list)
The device argument is an integer. The list argument is a list such as returned by queryparams(); it is modified in place (!).
al.setparams(device, list)
The device argument is an integer. The list argument is a list such as returned by queryparams().

38.1.1. Configuration Objects

Configuration objects returned by newconfig() have the following methods:

audio configuration.getqueuesize()
Return the queue size.
audio configuration.setqueuesize(size)
Set the queue size.
audio configuration.getwidth()
Get the sample width.
audio configuration.setwidth(width)
Set the sample width.
audio configuration.getchannels()
Get the channel count.
audio configuration.setchannels(nchannels)
Set the channel count.
audio configuration.getsampfmt()
Get the sample format.
audio configuration.setsampfmt(sampfmt)
Set the sample format.
audio configuration.getfloatmax()
Get the maximum value for floating sample formats.
audio configuration.setfloatmax(floatmax)
Set the maximum value for floating sample formats.

38.1.2. Port Objects

Port objects, as returned by openport(), have the following methods:

audio port.closeport()
Close the port.
audio port.getfd()
Return the file descriptor as an int.
audio port.getfilled()
Return the number of filled samples.
audio port.getfillable()
Return the number of fillable samples.
audio port.readsamps(nsamples)
Read a number of samples from the queue, blocking if necessary. Return the data as a string containing the raw data, (e.g., 2 bytes per sample in big-endian byte order (high byte, low byte) if you have set the sample width to 2 bytes).
audio port.writesamps(samples)
Write samples into the queue, blocking if necessary. The samples are encoded as described for the readsamps() return value.
audio port.getfillpoint()
Return the ‘fill point’.
audio port.setfillpoint(fillpoint)
Set the ‘fill point’.
audio port.getconfig()
Return a configuration object containing the current configuration of the port.
audio port.setconfig(config)
Set the configuration from the argument, a configuration object.
audio port.getstatus(list)
Get status information on last error.

38.2. AL — Constants used with the al module

Platforms: IRIX

Deprecated since version 2.6: The AL module has been deprecated for removal in Python 3.0.

This module defines symbolic constants needed to use the built-in module al (see above); they are equivalent to those defined in the C header file <audio.h> except that the name prefix AL_ is omitted. Read the module source for a complete list of the defined names. Suggested use:

import al
from AL import *