Alice Community  

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

Reply
 
Thread Tools Display Modes
song problems...
Old
acburton
Guest
 
Status:
Posts: n/a
Default song problems... - 02-23-2008, 11:29 AM

how can i make a song stop when need it to(needs to stopwith the press of a button and let another song play)
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 02-24-2008, 11:16 AM

One of the best recommendations in the text by Dunn, et al is that, if possible, a tool other than Alice be used for audio processing. For in-game control, however, this isn’t an option. One of the audio control parameters that does work pretty well is the volume control (range 0 to 1). Couple this with the fact that you can play two files at the same time and you can do things like the attached mixer program. (If you should actually use it, I recommend you keep track of the current volumes as shown in the photo – otherwise it is easy to loose track of the settings.)

As far as a stop option – I don’t believe one exists. You might be able to adjust the duration parameter somehow but I find it easier to just start a sound when needed and then set it’s volume to zero when you no longer want it. If you loop the sound – like the “clap” sound in the example – you can also stop the play loop when the sound is no longer needed.

One other comment related to audio - .wav files increase the size of the Alice program by an amazing amount (.mp3 is preferred). I had to zip the attached example to stay within the upload limit, even though there was less than 90 seconds of unique audio.
Attached Images
File Type: jpg Volume Control.JPG (19.1 KB, 111 views)
Attached Files
File Type: zip Audio Mixer.zip (12.55 MB, 260 views)
   
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 ©2019, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.