Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do you stop a sound?
Old
7yrold4Alice
Guest
 
Status:
Posts: n/a
Default How do you stop a sound? - 07-16-2013, 05:37 PM

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!
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 07-17-2013, 04:57 AM

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.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
You can stop sound?
Old
chickentree
Super Moderator
 
Status: Offline
Posts: 250
Join Date: Dec 2012
Location: Frosno, Ca
Default You can stop sound? - 07-17-2013, 10:17 AM

Quote:
Originally Posted by DensetsuNoKaboom View Post
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.
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
   
Reply With Quote
Thanks!
Old
7yrold4Alice
Guest
 
Status:
Posts: n/a
Default Thanks! - 07-17-2013, 11:58 AM

thanks!

It works!
   
Reply With Quote
wait....
Old
7yrold4Alice
Guest
 
Status:
Posts: n/a
Default wait.... - 07-17-2013, 12:20 PM

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?
   
Reply With Quote
Old
bob3584
Senior Member
 
Status: Offline
Posts: 180
Join Date: Jan 2013
Location: In a Cardboard Box.
Default 07-18-2013, 12:16 AM

Make sure you didn't miss something or make an error in your logic.


My avatar will always be a preview of what I am currently working on.
   
Reply With Quote
Old
DensetsuNoKaboom
Senior Member
 
DensetsuNoKaboom's Avatar
 
Status: Offline
Posts: 1,188
Join Date: May 2010
Location: e4eaf2
Default 07-19-2013, 06:20 AM

Post your world so we can look at it? That usually helps.


Thank you for taking the time to read this signature. This signature loves you.
   
Reply With Quote
Old
sfunk
Senior Member
 
sfunk's Avatar
 
Status: Offline
Posts: 1,112
Join Date: Mar 2011
Location: I don't know
Default 07-19-2013, 03:34 PM

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.


If you are stuck on a project, check out the tutorials I made here at this link:

http://alice.org/community/showthread.php?p=36778#post36778

There are lots of tutorials on it so far, including some youtube videos, check it out

Or..

Go to my youtube channel to check out my alice 2.2 tutorials I have there..

http://www.youtube.com/user/sfunk1992?feature=mhsn
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.