Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (alibaba, howardR, basik85278), 756 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
re-occuring sound #282906
08/04/09 15:13
08/04/09 15:13
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
My sound keeps initiating, looping over itself over and over, until the engine shuts down....
I wonder why the following does not seem to work...
Code:
if(snd_playing(engine_thrust) == 0)
{					
 snd_play(engine_thrust,50,0);
}


I call this inside the player action(loop).


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: re-occuring sound [Re: Nowherebrain] #282907
08/04/09 15:15
08/04/09 15:15
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
the sound file is defined as a standard sound...
Code:
SOUND* engine_thrust = "some_sound.ogg";//this is not the actual filename




Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/
Re: re-occuring sound [Re: Nowherebrain] #282915
08/04/09 16:08
08/04/09 16:08
Joined: May 2004
Posts: 1,510
Denmark
Claus_N Offline
Serious User
Claus_N  Offline
Serious User

Joined: May 2004
Posts: 1,510
Denmark
You need to use a sound handle, like this:

Code:
var snd_handle = 0; // global variable
...
if(snd_playing(snd_handle) == 0)
{					
 snd_handle = snd_play(engine_thrust,50,0);
}



Edit:
And if you want the sound to play over and over again, use snd_loop instead (stop it again using 'snd_stop(snd_handle);').

Last edited by Claus_N; 08/04/09 16:09.
Re: re-occuring sound [Re: Claus_N] #282917
08/04/09 16:27
08/04/09 16: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
Yeah, after looking in the manual I figured it out....thank you, I guess you cant redefine the same engine object to itself...or whatever I was doing...I get it now...again thanks.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/

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