| 07-01-2007, 09:21 AM | #1 |
Hi, I've seen that GUI Sound - Play Sound is PlaySoundBJ right? Which creates a sound and play it (and has to be destroyed afterwards). But what about StartSound()? Could I use StartSound(<some sound variable>), do I need to destroy it then? Does JASS have some better ways of playing a sound? |
| 07-01-2007, 09:42 AM | #2 |
sounds are never recycled or destroyed <_< (it's a fact) |
| 07-01-2007, 09:59 AM | #3 |
gg_snd_MySound.wav is a global variable, if I remember correctly. |
| 07-01-2007, 10:35 AM | #4 |
Well could you give me more details?? I know gg_snd_MySound.wav is a global variable, PlaySoundBJ somehow creates a sound......whoops, it was PlaySound, then it's practically StartSound, just stores the sound in last created sound. But what's the DestroySound for then? (in GUI also) |
| 07-01-2007, 11:06 AM | #5 |
call KillSoundWhenDone(<arguments>) did you use that yet? |
| 07-01-2007, 12:34 PM | #6 |
Well ok, lets look at the PlaySoundBJ function. JASS:function PlaySoundBJ takes sound soundHandle returns nothing set bj_lastPlayedSound = soundHandle if (soundHandle != null) then call StartSound(soundHandle) endif endfunction It obviously sets the last played sound to the soundHandle, if soundHandle isnt nothing then play it. As Toadcop said, it is never destroyed. You play a sound which is already made (when you define custom sounds in the sound editor), and thats about it, it checks if its not empty and plays it. |
| 07-06-2007, 09:01 PM | #7 |
Ok, but if nothing is destroyed, what's KillSoundWhenDone for? |
| 07-07-2007, 07:43 AM | #8 | |
Quote:
// you can check if they are recycled by playing a sound avery 2 seconds. and the sound duration is ~1 second. and if they were recycable then the handle id would be the same. i have tested alot and avery time i get new handles =\ |
| 07-07-2007, 12:01 PM | #9 | |
Quote:
|
| 07-08-2007, 02:49 PM | #10 |
Tnx, so Destroy Sound in GUI is useless. |
