(solved) How do I Pause all Music

Get help using Construct 2

Post » Wed Mar 19, 2014 6:54 pm

I'm pretty sure I am on the wrong track with this method, my code works just fine but I have about 5 songs in this game, sure I could do what I'm doing here and pause all the songs, but the issue is the resume. My problem is my user interface is a an "include layout" so I don't have to copy all that code for each layout.

Have I made one bit of sense in this post?

Example:

Image
Last edited by dthomasdigital on Sun Mar 30, 2014 12:55 am, edited 1 time in total.
B
25
S
10
G
3
Posts: 154
Reputation: 2,838

Post » Wed Mar 19, 2014 9:10 pm

You can use Audio > Set silent
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Wed Mar 19, 2014 10:47 pm

That is true but that kills all my sounds, I only want to kill all the music, but keep the rest of my sounds active.
B
25
S
10
G
3
Posts: 154
Reputation: 2,838

Post » Thu Mar 20, 2014 1:51 pm

What if you tag all the music as "music" and set mute for that tag?
C2 is definately lacking some channels on the audio object, something to link an sound to a channel and being able to mute just it.
Haven't looked at how to write plugins yet, but maybe that's something to look after now
Last edited by caiorosisca on Thu Mar 20, 2014 1:53 pm, edited 1 time in total.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Mar 20, 2014 1:52 pm

Now that is a interesting idea, bit then on resume music all the music would play.
B
25
S
10
G
3
Posts: 154
Reputation: 2,838

Post » Thu Mar 20, 2014 1:55 pm

Actually I don't think so. If your use MUTE, it will only unmuted the ones that were playing before, you are not calling PLAY. You can try with: mute, set volume to 0, pause. There are some different approaches to try out. I haven't messed that much with audio yet, so I can't tell you for sure which one would work.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Thu Mar 20, 2014 1:59 pm

If you plan to run your game on mobile, take note that there are many problems with audio support on mobile browsers and some of them do not respond to pause/resume,mute, volume and other audio commands.

You may find this thread useful https://www.scirra.com/forum/viewtopic.php?f=147&t=93968
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Thu Mar 20, 2014 2:03 pm

Thanks MaorKeshet I've not jumped on the mobile bandwagon yet but I need to and this is good information.
B
25
S
10
G
3
Posts: 154
Reputation: 2,838

Post » Sun Mar 30, 2014 12:55 am

caiorosisca wrote:What if you tag all the music as "music" and set mute for that tag?
C2 is definately lacking some channels on the audio object, something to link an sound to a channel and being able to mute just it.
Haven't looked at how to write plugins yet, but maybe that's something to look after now



I was wrong setting the tag to music works perfectly, at least for my needs, it's a great solution.
B
25
S
10
G
3
Posts: 154
Reputation: 2,838


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 10 guests