Thread: SoundUtils
View Single Post
Old 12-28-2010, 01:04 AM   #84
Procrastination Incarnate

Development Director
Join Date: Feb 2004
Posts: 8,190

Submissions (19)

Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)Anitarf has a brilliant future (903)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner


Would it be possible to provide a public Sound struct one could get to by typecasting the soundRef integers? Or better yet, make DefineSound return such a struct, it wouldn't affect backwards compatibility as long as the other functions still take an integer. The reason I ask is because I could really use a way to get the duration of the sound without requiring the users to pass it to my functions along with the soundRef itself.

Edit: Blizzard must have delegated sounds to the most incompetent programmer on the team. A couple of things I have discovered recently:

KillSoundWhenDone does not appear to actually destroy the sound handle, at least my handlecount kept going up in a test where I periodically created a sound and called KillSoundWhenDone on it. In any event, this needs further testing.

SetSoundPitch is not absolute, but relative to the sound's current pitch. This means that setting a sound's pitch to 1.0 will do nothing - if you had previously set a sound's pitch to 0.5 then to reset it you must now set it to 2.0. This means it is impossible to restart a sound you paused by setting it's pitch to 0.0 and recycling sounds that had their pitch changed will give you terrible problems.

There's also an issue with SetsoundPlayPosition which doesn't appear to work on a sound which hasn't started yet, which makes it useless when you try to use it on SoundUtils sounds, since a new sound will only be started after a small delay.

Working with sounds really is a pain. I was hoping I'd be able to avoid the issues by using SoundUtils, but there appear to be just too many of them for this library to be able to address them all.
Anitarf is offline   Reply With Quote