Director Help

Playing 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 file’s 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.