Playing and stopping sound
matthewadavid
Member Posts: 26
OK, I am starting simple. I have a game where the player can press different buttons on the screen. Each button kicks off a sound track that can play up 60 seconds. What I am having problems with is this: when a button is selected it plays the sound clip, when the next button is selected I want the first clip to stop and the new clip to start. Ideally I want to use the "touch" event.
Am I missing something?
Am I missing something?
Comments
Stop music
Timer after 0.2 seconds
play music ????
When I get to "Play Music" I can not choose from the Library of sound clips. All I get is "resume current music" in a drop down with no other choices. Am I missing something where I am not associating sound clips in the editor correctly?
Play Music can only use .m4a and .aac files.
I believe iTunes can make the appropriate file from a .ogg file.
Yes. Sound and Music are different. If you want to stop a sound from playing have it in a rule that when true it runs the Play Sound behavior (w/o the Run To Completion selected.) Making that false will stop the Play Sound behavior if it was playing.
Play Music/Pause Music/Stop Music are the related behaviors that only affect the music files.
Play Music can only use .m4a and .aac files.
I believe iTunes can make the appropriate file from a .ogg file.
Yes. Sound and Music are different. If you want to stop a sound from playing have it in a rule that when true it runs the Play Sound behavior (w/o the Run To Completion selected.) Making that false will stop the Play Sound behavior if it was playing.
Play Music/Pause Music/Stop Music are the related behaviors that only affect the music files.
new attribute for game = Initplay, to make sure the sound isn't playing when the app initiates.
new attribute for game playmusic as discussed above in the thread.
Then a rule for
When Actor receives Touch / Pressed
Change attribute game.playmusic to True
Then a rule to let Gamesalad know to play the sound when the attribute playmusic is true
When attribute game.playsound is True, playsound....
Now I want the sound to toggle off if I tap while it is playing...
I've tried a rule:
When Attribute game.playsound is True
and
Actor receives event Touch / Pressed
Change attribute game.playmusic to false
Has anyone any ideas, much appreciated!!!