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

PlaySoundEx

PlaySoundEx (int sound_number, int channel)
Plays sound effect SOUND_NUMBER on channel number CHANNEL.

About sound channels

AGS now uses a multi-channel sound system. There are currently 8 sound channels, numbered from 0 to 7. They are used as follows:

0 Background music, used by PlayMusic
1 Ambient sounds, used by PlayAmbientSound
2 Voice speech, used when you have automatic speech in your game.
3-7 Free channels, used by PlaySound, view frame sounds and so on.

When you use a Play Sound command, AGS automatically chooses a free channel from 3-7 to play the sound on. This means you can have up to 5 simultaneous sound effects. If they are all in use and you want to play another sound, one of the previous sounds will be cut off.

With PlaySoundEx, you can elect to play a sound effect on a specific channel, from 3 to 7. This gives you greater control of the sound effects, should you need it.

You cannot play a sound on channels 0-2 using this function, because there are separate ways of starting sound on those channels.

Example:

PlaySoundEx(3, 4);
will play sound 3 on channel 4. If a sound was already playing on channel 4 it will be stopped.

See Also: IsChannelPlaying, PlaySound, SetChannelVolume, StopChannel


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