Lingo Dictionary > S > sound playFile |
![]() ![]() ![]() |
sound playFile
Syntax
sound playFile
whichChannel
,
whichFile
Description
Command; plays the AIFF, SWA, AU, or WAV sound located at whichFile
in the sound channel specified by whichChannel
. For the sound to be played properly, the correct MIX Xtra must be available to the movie, usually in the Xtras folder of the application.
When the sound file is in a different folder than the movie, whichFile
must specify the full path to the file.
To play sounds obtained from a URL, it's usually a good idea to use downloadNetThing
or preloadNetThing()
to download the file to a local disk first. This approach can minimize problems that may occur while the file is downloading.
The sound playFile
command streams files from disk rather than playing them from RAM. As a result, using the sound
playFile
command when playing digital video or when loading cast members into memory can cause conflicts when the computer tries to read the disk in two places at once.
Example
This statement plays the file named Thunder in channel 1:
sound playFile 1, "Thunder.wav"
Example
This statement plays the file named Thunder in channel 3:
sound playFile 3, the moviePath & "Thunder.wav"
See also
![]() ![]() ![]() |