![]() |
#31 | |
default string
|
![]() Quote:
![]() |
|
![]() |
![]() |
Sponsored Links - Login to hide this ad! |
|
![]() |
#32 |
Procrastination Incarnate
Development Director
|
![]() Or you could just use Table for all your hashing needs.
__________________Anyway, is using timers really that much of an issue? In all cases, the timer will either match the sound perfectly or take longer than the sound, it will never finish faster than the sound (the ratio is 1:1 at fastest game speed). As such, the sound may not get recycled immediately when it finishes, but will recycle eventually. As such, it is a non-issue unless it's a looping sound, but why would you call ReleaseWhenDone on a non-looping sound? Also, local player sounds should be a non-issue. You play a sound once, either for all players or a specific player. If you need to play it for another player later, you get a new sound for that; so, the sound will get recycled for all players the moment it finishes for whoever it was played (or later, as mentioned in the above paragraph). I think the interface for this system could be simplified: a few functions could be merged, since I don't think anyone would ever use them separately anyway (Why would you ask for a sound if you weren't immediately planning on using it?): NewSound, RunSound and RecycleSoundWhenDone. Something like function RunSound takes soundhelper refSound, force playFor returns sound with completely automated recycling. By the way, what's the point of starting a sound in a new thread? |
![]() |
![]() |
![]() |
#33 | |
Obscurity, the Art
|
![]() Quote:
Hrm, you're right about the merging of all of those functions into a single function.. Personally, I like having access to the sound. Sometimes, I will call SetSoundVolume(MySound, 64) for a more quiet sound, and if I merged it all together I'd lose the ability to do that. I could certainly merge RunSound and RecycleSoundWhenDone, that one would make sense. |
|
![]() |
![]() |
![]() |
#34 | ||
extends net.wc3c.Jasser
|
![]() Quote:
I didn't know that. I might have inferred the thing from Starcraft... Thx for the info. Quote:
AIK the sound won't play for the first time on the thread where it is created. Last edited by ToukoAozaki : 09-01-2009 at 01:42 AM. |
||
![]() |
![]() |
![]() |
#35 | |
Procrastination Incarnate
Development Director
|
![]() Quote:
Last edited by Anitarf : 09-01-2009 at 01:48 AM. |
|
![]() |
![]() |
![]() |
#37 |
Obscurity, the Art
|
![]() Okay, updated per Anitarf's suggestions. I tested the returned sound on RunSound for edit-ability with the standard sound API and it seems that he was right. You can edit a sound's settings while it is running. Because of that, NewSound, RecycleSoundWhenDone, ReleaseSound, and RunSound have been merged together into just RunSound, simplifying the API greatly. If you want to stop your sound prematurely (before the duration expires), StopSound works for that.
__________________Last edited by Rising_Dusk : 09-03-2009 at 03:04 AM. |
![]() |
![]() |
![]() |
#38 |
User
Join Date: Jan 2007
Posts: 528
![]() ![]() |
![]() well about those settings, pitch is weird. you should be able to effectively pause a sound by setting its pitch to 0.0, and you can make all sorts of new sounds out of a sound file by changing its pitch, and freaky sounds by playing with the ptich as the sound is playing.
but i did some testing with changing pitch (coz i wanted to be able to pause sounds) and the result is sometihng like: (result may be different but its somewhat like this as i remember) you can decrease a sound's pitch before it plays, then increase it; you cant decrease a sound's pitch when it is playing, then increase it; you can keep increasing sound a sound's pitch (to the max (2.00?)); you can keep decreasing a sound's pitch. - something buggy with either decreasing-then-increasing or increasing-then-decreasing (both as a sound is playing), can't remember. the subsequent part doesnt succeed. |
![]() |
![]() |
![]() |
#39 |
oO
Join Date: Jul 2008
Posts: 580
![]() ![]() ![]() ![]() |
![]() Uh... an 8190 sized array in that struct means you can only have one sound type ever, no?
|
![]() |
![]() |
![]() |
#41 |
oO
Join Date: Jul 2008
Posts: 580
![]() ![]() ![]() ![]() |
![]() Oo /fail
|
![]() |
![]() |
![]() |
#42 |
Procrastination Incarnate
Development Director
|
![]() Won't the current code recycle sounds even if they are looping sounds?
__________________Another issue is the pitch, if it's set to a lower value by the user then the sound could get recycled before it even finishes. You'd need to do some hooking magic to SetSoundPitch as well as attaching timers to sounds to avoid that, though. |
![]() |
![]() |
![]() |
#43 | |
Obscurity, the Art
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#44 |
oO
Join Date: Jul 2008
Posts: 580
![]() ![]() ![]() ![]() |
![]() ![]() string fileName = "" integer duration = 0 boolean looping = false boolean is3D = false boolean stopwhenoutofrange = false integer fadeInRate = 0 integer fadeOutRate = 0 string eaxSetting = "" -> ![]() string fileName integer duration boolean looping boolean is3D boolean stopwhenoutofrange integer fadeInRate integer fadeOutRate string eaxSetting Same with soundhelper struct edit: Also, what does eaxSetting do? Last edited by Bobo_The_Kodo : 09-05-2009 at 02:13 AM. |
![]() |
![]() |
![]() |
#45 | |
User
Join Date: Apr 2008
Posts: 286
![]() |
![]() Quote:
Didnt blizzard fix that with patch 1.23b or something? |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
|