
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
.
Содержание DIRECTOR MX 2004-USING DIRECTOR
Страница 1: ...DIRECTOR MX 2004 Using Director...
Страница 16: ...16 Chapter 1 Introduction...
Страница 82: ...82 Chapter 3 Sprites...
Страница 98: ...98 Chapter 4 Animation...
Страница 134: ...134 Chapter 5 Bitmaps...
Страница 242: ...242 Chapter 10 Sound and Synchronization...
Страница 274: ...274 Chapter 11 Using Digital Video...
Страница 290: ...290 Chapter 12 Behaviors...
Страница 302: ...302 Chapter 13 Navigation and User Interaction...
Страница 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Страница 392: ...392 Chapter 16 Working with Models and Model Resources...
Страница 418: ...418 Chapter 18 Movies in a Window...
Страница 446: ...446 Chapter 22 Managing and Testing Director Projects...