Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by jcl. 11/04/26 10:30
[MED] Import from FBX (2010) missing!!!
by rayp. 11/03/26 14:33
What are you working on?
by rayp. 11/02/26 13:57
No connection to MT4
by JeyKey II. 10/29/26 09:34
Zorro plugin for Hyperliquid.xyz
by opm. 10/28/26 13:50
Icon "OP"
by JeyKey II. 10/27/26 07:03
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 13,155 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
dabolong, MaliceTheMaker, Haitao_Ren, JimSimons, julienp
19249 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 | 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