Sound Limitations

tooltiperror

Super Moderator
Reaction score
231
I see, but would it be faster to do (Im in a rush, sorry)
JASS:

func
call blablabla
if x
call sound two
return
if y
call sound three
return
endif

call sound one
end


Or would the extra calls at the end get in the way?
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
No because once an if/elseif is true, the others are not checked.
So take a better look, you win nothing, have more lines of code, basically you just make your code uglier.
 

BlackRose

Forum User
Reaction score
239
You could try to give a different position for each sound.

Nope :O

There is also a rumour where sometimes a sound isn't played the first time you try to play it.
To be sure you can create X sounds in an array, play all of them at map initialization, and then use them in your spell.

It's true. It happens for this, except since it's so continuous you won't notice the first sound for a string won't play.

Ok, the specific sound [I've tried others as well] still doesn't play constantly, I'm guessing there is a limit to how many instances of a sound can be played at once, like in the Sound Editor, holding CTRL + A there is a delay between each 'wave' of sound you try again. The short duration of the metal slice sounds, and the fact that it's split amonst 3 so the 'limit' isn't reached or is never noticed, is what makes such sounds work. Playing one sound repetively on such high frequency will quickly pass this undeclared limit, resulting in the awkward delay between the series of this sound.

That's what I look at it as. But.. if that is not the case. How do hardcoded sounds [say 20 Faerie Dragons attacking] work?
 

Tyrulan

Ultra Cool Member
Reaction score
37
Wouldn't it be cool if we could initialize secondary and tertiary sound streams? I've had an idea.. what if you change which filter the sound is using? (eg. Error, User Interface, Combat) and just rotate between 3-4 sounds like that? I'm almost entirely sure it won't work but hell, there's always a chance.
 

Troll-Brain

You can change this now in User CP.
Reaction score
85
By a "different position" i meant kinda the same but with a short offset (0.1 or so).
Maybe it will work, maybe not, even if it's more likely it won't work.

That's what I look at it as. But.. if that is not the case. How do hardcoded sounds [say 20 Faerie Dragons attacking] work?
In any real map i hadn't 20 faerie dragons attack at the same time, or at least in enough close time to reach this limit, you can try it but maybe it's the same limitation.
 

Weep

Godspeed to the sound of the pounding
Reaction score
401
Sounds are unfriendly to use... One thing I'd run into previously is that it seems that you can't start a sound or set its pitch in the same "tick" as you create it, not even in a new thread. A while back I wrote this:

JASS:
function DM_PeriodicSoundNewThread takes nothing returns nothing
	local sound s = CreateSound(whichSound, false, true, true, 10, 10, "SpellsEAX")
	call SetSoundChannel(s, 13)
	call SetSoundVolume(s, whichVolume)
	call SetSoundDistances(s, 600., 1200.)
	call SetSoundDistanceCutoff(s, 1200.)
	call SetSoundConeAngles(s, 0.0, 0.0, 127)
	call SetSoundConeOrientation(s, 0.0, 0.0, 0.0)
	call AttachSoundToUnit(s, GetEnumUnit())
	call TriggerSleepAction(0.) //Because sounds are fickle
	call SetSoundPitch(s, whichPitch)
	call StartSound(s)
	call KillSoundWhenDone(s)
	set s = null
endfunction

...if that's of any help.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top