How do you stop a sound?
How do you stop a sound? I want it like if you enter a room, the "Main sound" stops and a different sound starts. Help!
|
Create a Boolean variable, and set it to "true" when you want the song to start playing, and add a method to set it to "false" when you want the song to stop playing. Then make an event that says "while [variable] is true, play sound [music]".
If you want to have multiple pieces of music in your world, you could create a sound variable, and whenever you want the music to change, set the Boolean to false, change the sound variable to the new music, and set the Boolean to true again. |
You can stop sound?
[QUOTE=DensetsuNoKaboom;53234]Create a Boolean variable, and set it to "true" when you want the song to start playing, and add a method to set it to "false" when you want the song to stop playing. Then make an event that says "while [variable] is true, play sound [music]".
If you want to have multiple pieces of music in your world, you could create a sound variable, and whenever you want the music to change, set the Boolean to false, change the sound variable to the new music, and set the Boolean to true again.[/QUOTE] I thought sound was "play it all" in Alice and that once started it would continue until the track was done. Is this not true? Mark |
Thanks!
thanks!:cool:
It works! |
wait....
wait... The sound doesn't stop. Am I doing something wrong?
I made a Boolean variable, set it to false, and made it set to true when you are near something. I made Boolean variables for every sound and when ever a new sound comes, I set all the other Boolean variables to false, but the sound keeps on playing! what is happening? :confused: |
Make sure you didn't miss something or make an error in your logic.
|
Post your world so we can look at it? That usually helps.
|
Make sure that the method that has the sound playing is being constantly checked with a loop of some kind. And sometimes, depending on the size of the sound file or type it is, it may not work properly or immediately.
|
All times are GMT -5. The time now is 10:19 AM. |
Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.