User Guide
Chapter 12324
These statements queue the sound members Explosion and Siren and play them in succession in
sound channel 2:
sound(2).queue(member("Explosion"))
sound(2).queue(member("Siren"))
sound(2).play()
To control how a queued sound plays:
• Include optional parameters in a property list within the queue() function. See queue() in the
Lingo Dictionary.
When you use
setPlayList(), any previously set queue of sounds is replaced by the
new playlist.
After queuing sounds, you can still control whether the queue is obeyed. You can select to
interrupt loops with the
breakLoop() command or to pause playback with the pause()
function. The
playNext() command lets you skip immediately to the next sound in the queue.
For more information on sound commands, see the Lingo Dictionary.
Playing external sound files
In addition to playing sounds you have imported as cast members, you can also play external
sound files that have not been imported.
To play external sound files that aren’t cast members:
• Use the sound playFile command. See sound playFile in the Lingo Dictionary.
Playing external sound files from disk minimizes the amount of RAM that is used to play sounds.
However, because the computer can read only one item from disk at a time, loading cast members
or playing more than one sound from disk can cause unacceptable pauses when you use the
sound
playFile
command.
Controlling sound channels
You can use Lingo to make actions in a movie dependent on whether a sound is playing. Lingo
lets you determine whether a sound is playing in a particular sound channel and control how a
channel plays sound. For more information on each of these commands, functions, and
properties, see the Lingo Dictionary.
• To determine whether a specific channel is playing a sound, use the isBusy() function.
• To turn off the current sound in a specific channel, use the setPlayList() command with
[] as the new play list. This deletes the entire sound queue and leaves the current sound
playing. Use the
stop() command to stop the currently playing sound.
• To fade a specific channel’s sound in and out, use the fadeTo() function.
• To control a specific sound channel’s volume, specify the volume property.
• To control the left-to-right panning of a sound, specify the pan property.