Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Quad, AndrewAMD), 1,007 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple sound fading #133300
06/02/07 11:54
06/02/07 11:54
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
Probable I haven't had enough sleep last night I fail trying to make a simple sound fading function...things that worked before suddenly don't anymore

What am I missing?
Note: all vars are properly defined and set! Then function is called in the main after level_load. I don't get any error messages...just can't hear any sound. Should I check my ears or should I go to the brain doctor??

Code:
function weather_sounds()
{
var snd_handle_rain;
var snd_handle_wind;

var snd_vol_rain = 1;
var snd_vol_wind = 1;

snd_handle_wind = snd_loop(wind_wav, snd_vol_wind, 0);
snd_handle_rain = snd_loop(rain_wav, snd_vol_rain, 0);

while(1){

if(bad_weather == 1){

if(snd_vol_rain<100){snd_vol_rain += weather_soundfade_speed*time_step;}
if(snd_vol_wind>50){snd_vol_wind -= weather_soundfade_speed*time_step;}
}
if(bad_weather == 2){

if(snd_vol_rain>1){snd_vol_rain -= weather_soundfade_speed*time_step;}
if(snd_vol_wind<100){snd_vol_wind += weather_soundfade_speed*time_step;}
}

snd_tune(snd_handle_rain,snd_vol_rain,0,0);
snd_tune(snd_handle_wind,snd_vol_wind,0,0);

wait(1);
}
}



Re: Simple sound fading [Re: Loopix] #133301
06/02/07 14:49
06/02/07 14:49
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hi,

Quote:

var snd_vol_rain = 1;
var snd_vol_wind = 1;



Change both vars to 2, this does the trick for me!
I dont know why though..

Re: Simple sound fading [Re: Fenriswolf] #133302
06/02/07 15:18
06/02/07 15:18
Joined: Aug 2005
Posts: 1,558
HK
V
vlau Offline
Serious User
vlau  Offline
Serious User
V

Joined: Aug 2005
Posts: 1,558
HK
Check "weather_soundfade_speed", if it is 0,
then the sound volume will always be 1.

Even setting "weather_soundfade_speed" higher than 1,
your code still won't work for me, until I changed
"snd_loop", "snd_tune" to "media_loop", "media_tune"
respectively.

EDIT
----
I'm just test it with A6.6, maybe it will work on
lower version.


Last edited by vlau; 06/02/07 15:32.
Re: Simple sound fading [Re: vlau] #133303
06/02/07 15:39
06/02/07 15:39
Joined: Mar 2005
Posts: 969
ch
Loopix Offline OP
User
Loopix  Offline OP
User

Joined: Mar 2005
Posts: 969
ch
Thanks! I'll try media_loop I just don't see the reason why snd_loop woulden't work?? I'm using com 6.5.


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