acburton
02-23-2008, 10: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)
DrJim
02-24-2008, 10: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.