Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
[lost] sound problem #149039
08/19/07 16:38
08/19/07 16:38
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
I loop a sound(snd_loop, a waterfall in this case) and use a var to increse or decrease it's volume...using snd_tune and a var to adjust the volume.
I call it in the entity action in side a while loop(one problem), so the sound gets called and called and called...annoying.
I also cannot get it to respond to snd_tune, but this is how I want to adjust the volume...
I want to keep this in the ent action or create a sound ent using the aug model or something that I can set to invisible and passable later...
any knowledge that can be passed on would help.
Also, is there a trick to using the "add sound" in the editor, I can never get them to work.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
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 Offline
Member
quasarchangel  Offline
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 Offline
User
EpsiloN  Offline
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.

Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
Re: [lost] sound problem [Re: EpsiloN] #149042
08/19/07 18:31
08/19/07 18:31
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
so snd_tune is calling the snd_handle too, I thought it was just modifying the playing sound? if so then that is another problem I'm having....
I also need to define snd_handle as a global variable...(var snd_handle;)if I want to adjust the sound from a different function or ent correct?
I'll look further. Thank you.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: [lost] sound problem [Re: Nowherebrain] #149043
08/19/07 18:34
08/19/07 18:34
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Yes , define 50 snd handles and every time you assign a sound to a variable check to see if each one of them is empty. (Array...) You could than have multiple handles for multiple sounds and control them one by one.


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201
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 Offline
Member
quasarchangel  Offline
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: quasarchangel] #149045
08/20/07 00:45
08/20/07 00:45
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
eitherway...more typing than I want...I will find a solution, and I appreciate all the input...


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
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 Offline OP
Serious User
Nowherebrain  Offline 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.

Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: [lost] sound problem [Re: Nowherebrain] #149047
08/20/07 02:27
08/20/07 02:27
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline OP
Serious User
Nowherebrain  Offline OP
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
P.S. how do you get your code to show up correctly after typing it...I hate how mine always aligns to the left.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: [lost] sound problem [Re: Nowherebrain] #149048
08/20/07 12:18
08/20/07 12:18
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

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"
Page 1 of 2 1 2

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1