PlaySound()

Syntax:

PlaySound( Sound, Preload, Times, Volume, Start, Finish, FadeIn, FadeOut, Stop, Channel, Wait )

Parameters:

Sound – The name of the sound to play. Sound should be the full pathname of the sound file or the alias name given to the sound object in the Additional Resources tab of the page or Publication Properties dialog. This parameter is required.

Note:
Pathnames normally contain backslashes e.g. c:\song.wav, all single backslashes should be entered as double backslashes i.e. c:\\song.wav.

Preload – set if you want to preload a sound. Preload can be true or false. If true, the sound is preloaded. If false, the sound is not preloaded. This parameter is optional and the default is false.

Times – The number of times to play the sound. To play the sound continuously enter -1, otherwise enter a positive number. This parameter is optional. The default value is 1.

Volume – The percentage volume at which to play the sound. Volume must be a number between 0 and 100. This parameter is optional. The default value is 100.

Start – The start position, relative to the beginning of the sound, in seconds from which to play the sound. Start must be a positive number. This parameter is optional. The default is 0, which is the beginning of the sound.

Finish – The finish position, relative to the beginning of the sound, in seconds from which to finish the sound, or -1 to indicate the end of the sound. This parameter is optional. The default is -1.

FadeIn – a length in seconds in which to fade in the sound from the beginning. FadeIn must be a positive number. This parameter is optional. The default value is 0 i.e. no fade in.

FadeOut – a length in seconds in which to fade out the sound from the end. FadeOut must be a positive number. This parameter is optional. The default value is 0 i.e. no fade out.

Stop – Sets if the sound should stop when the page changes to another page. Stop can either be true or false. If Stop is true, the page will stop when the page changes. If Stop is false, the sound will continue when the page changes. This parameter is optional. The default is true.

Channel – a number indicating the mixer channel to use to play the sound. Channel must be a positive number, or the string ‘any’ to indicate that any channel can play the sound. This parameter is optional and the default is ‘any’.

Wait – Wait for this script command to complete before moving to the next script command, or not to wait. Wait is either true or false. If Wait is true, the script pauses until this animation is completed before continuing to the next line of the script. If Wait is false, the script will process the next line of script immediately. This parameter is optional. The default value is true.

Remarks:

This function will play a specified sound with the optional parameter settings. This function can play wave, midi, mp3 and other sound formats.

image\Script_Button.jpgExamples