Play Sound
Top  Previous  Next


Use this Action to play a sound.

Panels-Action-PlaySound  

Only sounds that have been imported can be selected. Use the 'Import...' or 'Reload' buttons to import/reload a .wav or .mp3 sound file.

Note:
·Due to a limitation in the Flash Player, sounds will only play in response to a Frame Event, or the Mouse Events Press, Release, Roll Over or Roll Out. Sounds cannot be played in response to the Mouse Events Drag Over, Drag Out or Release Outside  
·Due to a limitation in the Flash Player, MP3 sounds must have sample rates of 11025Hz, 22050Hz or 44100Hz  
·The Play Sound action will ALWAYS play, even inside a conditional statement. This means that you cannot use conditional statements (such as if, else if, etc) to trigger the Play Sound action, because it will play regardless of the conditions. To get around this limitation, you can put a gotoAndPlay event inside the Conditional statement, and send the timeline to a frame that contains the Play Sound action (either inside a sprite, a level, or the _root).  

Import...
You can import a sound file into the Movie using the 'Import...' button. You can import Windows .wav files or .mp3 sound files.

Reload
You can reload a previously loaded sound file by selecting the sound in the 'Content' tree and using the 'Reload' button. This is useful if the sound file on disk had changed since the last time it was loaded.

Delete
You can delete a sound file from the Movie by selecting it in the 'Content' tree and using the 'Delete' button. This does not delete the sound from your disk drive, it only removes it from within the .swi file so it can't be played.

Properties
Also available form the 'Content' tree, the 'Properties' dialog allows you to modify properties for a sound file including Compression, Channels and Sample Rate.

Panels-Action-PlaySound-Properties  

·Imported sound properties: displays the settings used on importing the sound file  
·Preload sound: specifies when the sound is defined in the .swf file. See the discussion on the Object page of the Export Panel for more information  
·Export settings: displays the settings used when the Movie is exported:  
·Compression: specifies the sound compression method. The available options are None, ADPCM and MP3  
·Channels: specifies whether the sound will play in Mono or Stereo  
·Sample Rate: specifies the sample rate for the sound file. The available options are 5.5, 11, 22 and 44kHz  
·Use LAME MP3 encoder: available when using MP3 compression. This option makes SWiSHmax use LAME MP3 encoder to compress the sound instead of using Windows' MP3 CODEC  
 
Note: There is an option to 'Always use the LAMEencoder to encode MP3 sound' in the Tools | Preferences dialog box  
 
·Sample Bits: available when using uncompressed sound, it defines the bits used for each sample. Higher settings will create better quality sound, though larger size files  
·ADPCM Bits: available when using ADPCM compression, it defines the bits used for each sample. Higher settings will create better quality sound, though larger size files  
·Play: plays the sound with the current setting. The 'Play' button also updates the number of bytes for the sound file, as shown under the 'Stop' button  
·Stop: stops the currently playing sound. This is useful for a long sound, or a sound with a large number of loops  

Sound Effect
The 'Sound Effect' dialog box allows you to modify how the sound file is played for this Action.

Panels-Action-PlaySound-Settings  

·Don't play sound if it is already playing: lets you stop a sound being triggered multiple times  
·Sound effect: specifies simple sound Effects, including fading in or out and panning effects  
·Loop sound: specifies how many times the sound will be played. In the example above, the sound called "88A.mp3" is played 1 time. Due to a limitation in the Flash Player, there is no infinite loop option. If you want your sound to loop for a very long time, enter a large number, such as 50,000  
·Volume: specifies the volume of the sound for playback as a percentage of the original volume  
·Fade in first loop: fades in the first loop played for the sounds file  
·Fade out last loop: fades out the last loop played for the sound file  
·Play: plays the sound with the current setting. The 'Play' button also updates the number of bytes for the sound file, as shown under the 'Stop' button  
·Stop: stops the sound currently playing. This is useful for a long sound, or a sound with a large number of loops  

Note: Setting the 'Loop Sound' option to "0" (zero) will only play the sound file one time .. In other words, it will loop 'zero' times - thus only playing through one full time. Also, changing the number of loops does not increase or decrease the filesize of the exported .SWF file.

Content tree
The 'Content' tree shows you the sound Objects that are available for playing in this Movie.

In the example below, the sound called "88A.mp3" is played when the movie reaches Frame 10.

Panels-Action-PlaySound-Example  

See also Adding Music and Sounds for further information.