PDA

View Full Version : how do I stop sound?


the almighty bob
10-30-2006, 11:45 PM
I'm making a little game, and I would like to be able to stop and switch the song by pulling a lever. Can someone explain how I would go about doing this?

thetrippster
10-31-2006, 07:55 AM
umm if and else could be used or variables work.....but im not to great with them yet. :( im still learning.

Shadow Sovereign
10-31-2006, 07:58 AM
Ditto.

Kirbya
11-04-2006, 06:30 PM
I've tried several different things and I can't figure this out either..

DrJim
11-04-2006, 07:42 PM
From an outsider's point of view, all Alice seems to do is retrieve the sound file, set a time limit on it and send it to a sound card - a very reasonable approach considering the variations on audio hardware around. (I thought the Dunn, et al, text even specifically recommended using an external sound editor but I can't find the reference on a quick look.) Once you start playing a sound, it plays to the "end" (either the actual end or the end set with the call) and you can't turn it off.

Thus if you want to switch a background song off and on, you need to use a small, repetitive sound segment (2-3 bars to one verse) - use the "Sound Editor" that comes as a Window's accessory to get something useful - and put the segment into a While loop, event call or something similar. The segment will just keep repeating until the test condition goes false.

Jordan906
03-07-2009, 09:55 PM
1st-You Have to make a variable "StopSound" and set its value to the length of your sound
2nd-drag the "StopSound" variable to the duration of your sound
3rd- Make a method that will set the value of "StopSound to 0"

and there you go. you can set the method in an if/then, a while, when a key is typed ect...