
236
Chapter 10: Sound and Synchronization
After queuing sounds, you can still control whether the queue is obeyed. You can select to
interrupt loops with the
breakLoop()
method or to pause playback with the
pause()
method.
The
playNext()
method lets you skip immediately to the next sound in the queue. For more
information about sound methods, see the
Director Scripting Reference
.
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()
method. For more information about this method, see the
Scripting Reference topics in the Director Help Panel.
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()
method.
Controlling sound channels
You can use Lingo or JavaScript syntax to make actions in a movie dependent on whether a sound
is playing. Lingo or JavaScript syntax lets you determine whether a sound is playing in a particular
sound channel and control how a channel plays sound. For more information about the following
methods and properties, see the Scripting Reference topics in the Director Help Panel.
•
To determine whether a specific channel is playing a sound, use the
isBusy()
method.
•
To turn off the current sound in a specific channel, use the
setPlayList()
method with
[ ]
as the new play list. This deletes the entire sound queue and leaves the current sound playing.
Use the
stop()
method to stop the currently playing sound.
•
To fade a specific channel’s sound in and out, use the
fadeTo()
method.
•
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.
About Windows Media Audio
Microsoft Windows Media Audio (WMA) is an audio codec designed by Microsoft for use with
streaming content at CD quality. It is designed to resist data loss that can cause signal degradation
and can improve download times for audio. It is similar to MP3, with two main advantages: it
works better with low bit-rates (8-64 kbts per second) and it can, in general, produce better
quality sound at a given bit-rate than MP3. It is generally recommended for music and general
sounds, but not for voice. You can use WMA content in Director through the Windows Media
feature. You must also have the proper decoders installed. For more information about using
WMA and Windows Media in general, see
“Using Windows Media files in Director”
on page 252
.
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...