How do i stop sounds?

Get help using Construct 2

Post » Mon Feb 25, 2013 5:39 am

How do i stop the sounds in Construct? Even if i set the sounds to silent or stop, it still play ad it overlaps when i go to another layout.
B
7
S
2
G
3
Posts: 12
Reputation: 2,586

Post » Mon Feb 25, 2013 6:40 am

Just as you said, by using Stop. You've made a mistake somewhere in the event sheet and either you're not stopping the right sound or it's just playing itself again after. No way to know for sure without more information.
B
6
S
1
Posts: 67
Reputation: 986

Post » Mon Feb 25, 2013 10:55 am

I think he is actually right, nothing with Sounds or Music seems to work properly, which release of Construct 2 are you using?

I use the latest Beta 120.2, but I also had this problem long before this beta release, just haven't got around to post about it.

In my tests I actually managed to get music to stop playing by leaving the Tag empty so it effects the last played sound. But its not a workaround the problem though, since its useless if any other sound plays in between.

I currently only use .ogg files in my project, but that shouldn't matter.
B
58
S
28
G
7
Posts: 13
Reputation: 6,203

Post » Wed Feb 27, 2013 11:02 am

Could anyone confirm if they can do a simple action like this?

Just as an example.

On "P" pressed - Audio / Play "music file name"
On "M" pressed - Audio / Stop "music file name"

I can't get a simple thing like this to work and I can't see that it should be any more complicated then this.

If I leave it like this, On "M" pressed - Audio / Stop ""
Then it works to stop the last sound/music played.

Thanks in advance for any reply.
B
58
S
28
G
7
Posts: 13
Reputation: 6,203

Post » Wed Feb 27, 2013 2:46 pm

You play by NAME, but stop by TAG. Heres a sample:
SoundSample.capx
ImageImageImage
B
67
S
19
G
124
Posts: 3,219
Reputation: 74,425

Post » Wed Feb 27, 2013 9:40 pm

@blackhornet Thanks!

Have looked at your file, so one can't just write the name of the music file in the Tag to stop? So it has to be set up with global numbers? Sounds very strange.

Will try, but still make no sense why I can't just write the name of the music file I want to stop.Tsengar2013-02-27 22:01:57
B
58
S
28
G
7
Posts: 13
Reputation: 6,203

Post » Wed Feb 27, 2013 10:02 pm

@Tsengar: I've updated my "This is how audio works capx example (r120.2) and the sound loops and stops in FF as intended.

Are you sure you give a correct tag on play and use the correct tag on stop (case sensitive) ?
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Feb 28, 2013 1:23 am

Simplified: When you play the sound, give it a tag. To stop the sound, use that same tag, not the name.
ImageImageImage
B
67
S
19
G
124
Posts: 3,219
Reputation: 74,425

Post » Thu Feb 28, 2013 4:24 am

Thanks folks! very helpful
B
18
S
1
G
1
Posts: 34
Reputation: 1,661

Post » Thu Feb 28, 2013 5:02 am

The key to stopping sounds effectively is creating tags when you define an event with the "Audio Play" action. "Play" is the action that allows you to tag a sound. Construct 2 marks its as "optional", but in fact you must tag every sound file for later use with other actions. Be careful with Lowercase/Uppercase for your tags!!!
B
17
S
4
G
3
Posts: 73
Reputation: 3,723

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests