1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: [lost] sound problem
[Re: Nowherebrain]
#149040
08/19/07 17:25
08/19/07 17:25
|
Joined: Nov 2006
Posts: 141 South Africa
quasarchangel
Member
|
Member
Joined: Nov 2006
Posts: 141
South Africa
|
Check it in the loop with a snd_playing(snd_handle) function. Thinking about other requests...
God DID give us a manual on how to change this world...
|
|
|
Re: [lost] sound problem
[Re: Nowherebrain]
#149041
08/19/07 17:26
08/19/07 17:26
|
Joined: Jan 2006
Posts: 968
EpsiloN
User
|
User
Joined: Jan 2006
Posts: 968
|
First... Code:
snd_tune (Handle, Volume, 0, 0);
And second...call the snd_loop from outside the while loop. Eg. : You have: Code:
while(1) { snd_handle = snd_loop(sound_file_str,100,0); wait(1); }
Change it to: Code:
snd_handle = snd_loop(sound_file_str,100,0); while(1) { if(key_a == 1) { snd_var += 5 * time; } if(key_d == 1) { snd_var -= 5 * time; } snd_tune(snd_handle,snd_var,0,0); wait(1); }
Hope this helps EDIT: Right click > Add > Add sound > Sound file.wav Right click while selected > Properties > Change the range (shouldnt be too small) and the volume. Build as normal (default) and enjoy stereo
Last edited by EpsiloN; 08/19/07 17:42.
|
|
|
Re: [lost] sound problem
[Re: EpsiloN]
#149044
08/19/07 19:05
08/19/07 19:05
|
Joined: Nov 2006
Posts: 141 South Africa
quasarchangel
Member
|
Member
Joined: Nov 2006
Posts: 141
South Africa
|
Or you could use one of the current entity's skills as a handle.
God DID give us a manual on how to change this world...
|
|
|
Re: [lost] sound problem
[Re: Nowherebrain]
#149046
08/20/07 02:26
08/20/07 02:26
|
Joined: Jul 2005
Posts: 1,002 Trier, Deutschland
Nowherebrain
OP
Serious User
|
OP
Serious User
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
|
OK, I'm sooo frustrated right now...I had to walk away... I'm positive I know what I am doing and it either.. a)doesn't play. b)loops over itself eternaly. AAAAHHHHHHH!!!!
here is my basic implementation... sound waterfall = <water.wav>; var volume; var s_handle; action some_action { set some stuff(passable etc..) s_handle = snd_loop(waterfall, volume,0); while(player != null) { if(vec_dist(player.x,my.x) < 1000) { volume += 1 * time_step/4; } snd_tune(s_handle,volume,-10,0); wait(1); } } I may have missed a bracket, but this is my "basic" setup. I've even tried setting the handle in a separate loop(same action)before this main loop.
Last edited by Nowherebrain; 08/20/07 02:29.
|
|
|
Re: [lost] sound problem
[Re: Nowherebrain]
#149048
08/20/07 12:18
08/20/07 12:18
|
Joined: Jul 2007
Posts: 959 nl
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
i searc and seacrh but i did found it i think
s_handle = snd_loop(waterfall, 1,0);
"empty"
|
|
|
|