Is there any way to stop only one sound coming from an

Game Editor comments and discussion.

Is there any way to stop only one sound coming from an

Postby Sgt. Sparky » Wed Jan 24, 2007 8:22 pm

actor? cus' I am makin' this music game where the notes can get held out, but... WQhen I do stop sound it stops all the sound when there are supposed to be more than one music note at a time :cry: any Ideas :) :o :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby irblinx » Thu Jan 25, 2007 12:06 am

Probably not much use to you here but;

To prevent a sound being played in the first place you could use a variable for the sound volume (just for that one sound) and then adjust the volume level by altering the variable (i.e. make is 0 to turn the sound off)

Code: Select all
PlaySound2("data/yoursound.wav", soundVolume, 1, 0.000000);


Where soundVolume is a Global variable.

Not sure about altering it whilst it's being played though, :(
irblinx
http://www.irblinx.me.uk/Crania.htm
Current projects: Crania deluxe for Mac, iCrania
User avatar
irblinx
 
Posts: 122
Joined: Wed Apr 19, 2006 11:15 am
Location: Manchester, UK
Score: 6 Give a positive score

Postby makslane » Thu Jan 25, 2007 1:09 am

makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Sgt. Sparky » Fri Jan 26, 2007 9:35 pm

But that does not work when you have 1 actor that makes 2-13 the sounds at the same time :(
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby makslane » Sat Jan 27, 2007 3:06 am

Use the channel returned in the play funcions.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Sgt. Sparky » Sat Jan 27, 2007 3:07 pm

could you please describe the code :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby makslane » Sat Jan 27, 2007 8:26 pm

Create a variable (integer, actor) to hold the sound.
In the play function, use:

Code: Select all
channel = PlaySound2("data/sound.wav",  1, 1, 0);


To stop this sound, just use:

Code: Select all
stopSound(channel);


If you need control more than one sound per actor, add more variables, or use an array.
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Sgt. Sparky » Sat Jan 27, 2007 8:52 pm

okay thank you! :D
(I think You are going to get a free new version of GE :wink: )
no wait! you made GE! :D
1+karma
EDIT: why do you not have an Icon?(Avatar)
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron