HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

sounds in JASS

12-13-2006, 07:52 PM#1
darkwulfv
I've heard about it, dynamic sounds I think they were called. So...How do you use like, local sounds in JASS or whatever. I've never had to use them till now. It's not music, btw, its a sound. Thanks for any help...Or to anyone who points me towards a tutorial that explains this.
12-13-2006, 08:27 PM#2
Anitarf
Collapse sound use sample:
    local sound snd = CreateSound(path, false, false, false, 10, 10, "")  //path is a string
    call SetSoundPitch(snd, 1.0)  //sets the speed of the sound, use any positive real, 1.0 is normal pitch
    call SetSoundVolume(snd, 127)  //sets the volume of the sound, input an integer between 0 and 127
    call StartSound(snd)
    call KillSoundWhenDone(snd)  //automatic cleanup to avoid leaks
    set snd = null
Something like this.
12-13-2006, 08:29 PM#3
MrApples
Do you mean playing a sound for a individual player?
Collapse JASS:
if (GetLocalPlayer()==GetTriggerPlayer()) then
call StartSound( gg_snd_SoundNameHere )
endif
12-13-2006, 08:38 PM#4
darkwulfv
Thanks a bunch Anitarf. I found PlaySound in JASScraft but not the modifiers (like pitch). I'll go use this.