- Joined
- Oct 12, 2011
- Messages
- 3,449
I wonder, is there a way to play a same sound at more than 3 different location and the sound played correctly?
as example I have a sound variable named S and 10 locations named loc1,...,loc10. I want to play that sound at those locations at the same time, but seems like only one sounds played.. or another case, I played a same sound with 3 seconds duration at one location every 0.05 seconds. The sounds can't be played rapidly.
so the question is, is there a way to solve this?
answer
as example I have a sound variable named S and 10 locations named loc1,...,loc10. I want to play that sound at those locations at the same time, but seems like only one sounds played.. or another case, I played a same sound with 3 seconds duration at one location every 0.05 seconds. The sounds can't be played rapidly.
so the question is, is there a way to solve this?
answer
JASS:
function PlaySoundAtPoint takes string f, real x, real y returns nothing
local sound s = CreateSound( f, false, true, true, 10, 10, "" )
call SetSoundDuration( s, GetSoundFileDuration(f) )
call SetSoundChannel( s, 0 )
call SetSoundVolume( s, 127 )
call SetSoundPitch( s, 1.0 )
call SetSoundPosition(s, x, y, 0)
call StartSound(s)
call KillSoundWhenDone(s)
set s = null
endfunction
Last edited: