Duck choir lol too funny
In the most simple terms you can use this:
if (GetSoundsPlaying(Ducksnd ) = 0) then PlaySound(Ducksnd , 0)
What you may want to look at here is using the instance of the sound. Every time you run PlaySound() it is making an instance of that sound and is returning a reference that instance with a unique ID.
SetErrorMode(2)
SetWindowTitle( "Fun" )
SetWindowSize( 640, 640, 0 )
SetWindowAllowResize( 0 )
SetSyncRate( 60, 0 )
UseNewDefaultFonts( 1 )
REM Load resources
Ducksnd = LoadSound("ANIMAL_Duck_10_mono.wav")
do
if GetRawMouseLeftPressed() = 1
if (GetSountInstancePlaying(DuckInstance) = 0)
DuckInstance = PlaySound(Ducksnd,100,1,0)
print("played")
endif
endif
Sync()
loop
With a reference to the sound instance you can now set all kinds of fun things like SetSoundInstanceBalance(DuckInstance, -1.0) to put it in the left channel or SetSoundInstanceBalance(DuckInstance, 1.0) for the right channel. Set that particular instance's volume with SetSoundInstanceVolume(). And for even more fun try playing with SetSoundInstanceRate() to change the pitch and add your own doppler affect if the duck is flying by you.