<<<<<<<<<<<<<<<<<

Sound(lib) LYMB Sound(lib)

NAME

sound - abstract class for sound library interfaces

DESCRIPTION

The sound class is an abstract class which provides a device independant interface to the device specific sound classes. The device specific sound classes are subclasses of this class and are not ment to be used directly by the user. The sound class provides all of the interfaces to these subclasses and the methods of these subclasses are not directly accessable by the user. This setup is analogous to the abstract device independant renderer class and the device specific renderers, such as vogle. This mechanism allows scripts to be portable amoung various sound devices.

An environmental variable LYMB_SOUND needs to be defined to tell the sound object which type of sound device is available on the system. For example, on the Sun Mircosystems SparcStation line, set LYMB_SOUND to sun_sound.

The sound class is an interface to the sound device associated with the computer system on which LYMB is being executed. The sound device does not contain any data. The data is contained in an instance of the sound_data class which is associated with the sound class by the data_in instance variable and data_in= method.

SUPERCLASS

object

INSTANCE VARIABLES

device The name of the sound device to be used. On the Sun SparcStations, this is /dev/audio.

control_device The name of the sound controller device. This allows such interactions as pause, resume, and stop. It can be written to idependantly of the sound device. On the Sun SparcStations, this is /dev/audioctl.

gain The gain, or loudness, that the sound device will play an sound.

data_in The name of the sound_data container object to contain the sound data to be played.

MESSAGES

device[=?] Set/get the name of the sound device. This is automatically set upon initialization (initialize!).

control_device[=?] Set/get the name of the sound control device. This is automatically set upon initialization (initialize!).

gain[=?] Set/get the gain, or loudness, of the playback device. This is a floating point value between 0.0 and 1.0. It it is out of range, the value remains unchanged.

data_in[=?] Set/get the name of the sound_data object containing the sound to be played. The data must be in the correct format for the sound device.

initialize! Initialize the sound device.

play! Play back the sound data associated with data_in. The data will be written to the sound device in pieces inside a signal handler routine which is periodically called. This allows control to be immediately passed back to the user and allows other interactive manipulation, such as changing the gain or pausing the playback.

wait! Force the sound object to wait until the sound data has completed playback before returning control back to the user.

pause! Pause the playback of the curently playing sound.

resume! Resume the playback of a previously paused sound.

stop! Stop the playback of the currently playing sound. This will stop any further amounts of the current sound data from being written to the sound device and it will flush any data currently in the sound device. Once a sound is stopped, it can't be resumed. It will need to be restarted by play!.

EXAMPLES

SEE ALSO

sound_data, sun_sound, sgi_sound, sound_reader, sun_sound_reader, sgi_sound_reader


Please send comments and suggestions to
consult@rpi.edu