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.
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.
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!.