| 03-07-2008, 02:56 PM | #1 |
Anyone has something like this? I hate making sound handles in sound editor and than using those gg_snd stuff in code. So basically I need something to play sounds from path strings (like you can create special effects from strings) |
| 03-07-2008, 03:36 PM | #2 |
...CreateSound native...? |
| 03-08-2008, 06:58 AM | #3 |
A quick example using Power of the Horde song: JASS:scope Sound globals private constant sound PH = CreateSound("Sound\\Music\\mp3Music\\PH1.mp3" , true , false , false , 10 , 10 , "DefaultEAXON") endglobals private function SSound takes nothing returns nothing call SetSoundParamsFromLabel(PH, "PHMusic") //Not needed, this make it more accurate call SetSoundDuration(PH, 281582) //Not needed, just gives a more accurate sound duration call SetSoundVolume(PH, 127) //You don't need this, I wanted a louder song call SetSoundPitch(PH, 2.0) //You don't need this, I just wanted a fast pitch endfunction private function PSound takes nothing returns nothing call StartSound(PH) endfunction public function InitTrig takes nothing returns nothing local trigger t = CreateTrigger() call SSound() call PSound() endfunction endscope If you are wondering, for CreateSound(), the first boolean is for it to loop or not, the second is to make the sound 3d or not and the third is whether is stops when its out of range or not. The first integer is the fade in rate, the second is the fade out rate. Finally, the string at the end can be left at "", its just used to put it into a label group. To get the path name either: a) Open up the mpq, and get the path from there. b) Make a variable in WE, open your map in a JASS viewer, and get the path at the 'InitSounds' function. |
| 03-08-2008, 08:12 AM | #4 |
Tnx Bone, I didn't know it would be so complicated ![]() I mean compared to effects.... Well not complaining ... time to learn. |
| 03-08-2008, 11:49 AM | #5 |
i have one =) you can try to rip it out from TcX ^^ it's "percache" sounds. etc. and also store any sound in a "compact stack". the sys don't start the sound self so you can do it localy etc. =) but anyway it was designed for me =) and yes the total limit of sounds is 8190 =) (and yes it uses cache to get id of the sound stack by the file name) but it's not so slow. (but it gives save\load compability) and yes it doesnt remove sound due they are not removed properly. (leaking you can test it.) |
| 03-08-2008, 01:42 PM | #6 |
And how about you PM me that system? |
| 03-08-2008, 03:23 PM | #7 |
no i don't =) do it self or forget. due your specific code requirments -_-. i don't have time to fuck around it. // search for SNDX. |
| 03-08-2008, 03:32 PM | #8 | |
JASS:native SetSoundDuration takes sound soundHandle, integer duration returns nothing In what metric is the duration? Quote:
Or maybe you are just a selfish ass... |
| 03-08-2008, 04:30 PM | #9 | ||
Quote:
Quote:
omg noobozzz -_- // it's simply shows your low level mapmaking skill. don't ask why it's made so. i allready told i made it for my purporses. // ABCTT i must rework it into a stand alone map =\ but well it's it may looks strange but how i allready mentioned (2 times) it's was writen for specific map not in universal way. Sassot - Where it all begun vs Karen Overton - Your loving Arms (accapella) :pray: |
| 03-08-2008, 06:41 PM | #10 | |
Quote:
Why always people say it was map specific as an excuse for shitty code? Anyways I wanted to ask you: Why did you make it so? Well nwm I have no time for making another system right now, if you are serious about making this into something decent try to make it in the next 15 days, I could use a good sound system. (Or maybe I simply don't need system but don't realize that because I know nothing about wc3 sounds right now....) Meh have too much other things to think about... |
| 03-08-2008, 11:47 PM | #11 |
although, kind of off topic, I love how in TCX, when you slow the game engine, the sounds slow down too. Sound natives are easy enough to use. I usually declare all the sounds at map init and then just get the from an array when needed. |
| 03-09-2008, 03:26 AM | #12 |
Ammorth yes but sometimes you need dynamicaly to create sounds ;) (thats the problem cause 1 sound can play 1 time at once so no overlapping effect == sounds lame.) and btw the most problematic are the 3D sounds. to play simple sound is simple. |
| 03-09-2008, 01:23 PM | #13 |
i think the best and the most awesome way is to use the cache for save the sound parameters depends the path of the sound. and yes that's too crazy if you use many sounds ... |
