spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

 

spacer graphic
Menu
spacer graphic Home
About
News
Features
Download AGS
spacer graphic Games 
Games main page
Award Winners
Picks of the month
Short games
Medium length games
Full length games
In Production
Hints & Tips
Community
Forums
AGSers World Map
Member websites
Chat
Resources
Tutorials
FAQ
Knowledge Base
Downloads
Links
AGS-related links
* AGS Manual
  * Scripting
    * Multimedia functions

PlaySound

PlaySound (int sound_number)
Plays a sound effect. The game will search for SOUNDx.OGG, SOUNDx.MP3, SOUNDx.WAV and SOUNDx.VOC (where x is SOUND_NUMBER) and play the first one it finds.

This command will find a free channel to play the sound on, if it can. Otherwise, it will silence any previously playing sounds and override them with the new sound.

Pass -1 as SOUND_NUMBER to stop any currently playing sounds.

This command returns the channel number that the new sound is playing on, or -1 if it did not play for any reason.

Example:

PlaySound(3);
will play sound3.mp3

See Also: PlayMusic, PlaySoundEx


User comments and notes
There are currently no user comments on this page.
The user comment facility is currently disabled.