User Guide

Playing Shockwave Audio, Windows Media Audio, and MP3 audio with Lingo or JavaScript syntax 239
4 Drag the Shockwave Audio cast member to a sprite channel (not one of the sound channels) to
create a sprite. Extend the sprite through all frames in which the sound should play, or use the
tempo channel to make the movie wait for the end of the sound. For more information, see
“Synchronizing media” on page 240.
You cant place streaming audio cast members in the sound channels. The sound streams from
the source location when the movie plays.
Playing Shockwave Audio, Windows Media Audio, and MP3
audio with Lingo or JavaScript syntax
Use SWA script to preload and control SWA and MP3 sounds and to determine how much
sound has streamed over the Internet.
Script that controls other types of sounds can also control streaming SWA and MP3 sounds by
controlling the sound channel in which the sound plays. For more information about the
following methods and properties, see the Scripting Reference topics in the Director Help Panel.
To preload part of a streaming sound file into memory, use the preLoadBuffer member
method.
To specify the amount of a streaming cast member to download before playback begins, set the
preLoadTime cast member property.
To determine what percentage of a streaming sound file has played, test the percentPlayed
cast member property.
To determine the percent of a streaming file that has streamed from an Internet server, test the
percentStreamed cast member property.
To specify the sound channel in which a streaming sound plays, set the soundChannel
property.
To begin playback of a streaming cast member, use the play member method.
To pause a streaming sound file, use the pause member method.
To stop a streaming sound file, use the stop member method.
To determine the state of a streaming sound file, test the state cast member property.
To determine whether an error occurred when streaming a sound file, use the getError()
method.
To obtain a string describing an error that occurred when streaming a sound file, use the
getErrorString() method.
To determine the length of a streaming sound file, use the duration cast member property.
To determine the bit rate of a streaming sound cast member, test the bitRate cast member
property.
To determine the original bit depth of a streaming sound, test the bitsPerSample property.
To determine the sample rate of the original sound used for a streaming cast member, test the
sampleRate cast member property.
To determine the number of channels in a streaming sound, test the numChannels streaming
cast member property.
To specify a streaming sound’s volume, specify the volume streaming cast member property.
To specify a streaming sound files URL, set the URL cast member property.
To obtain or set the copyright text in a streaming sound file, test or set the copyrightInfo cast
member property.