How do I mute sounds only

Get help using Construct 2

Post » Wed Sep 23, 2015 6:22 pm

Hi,

I have a problem muting sound effects. The problem is that I have sound effects and music, that need to be muted separately. I can do this with tags, by applying "sound" tag to all sounds and "music" to all music. But when I need to stop sound from playing, its impossible, as there are no multi tags allowed. Is there a way to mute sounds only without tagging them?
B
3
Posts: 7
Reputation: 193

Post » Wed Sep 23, 2015 7:02 pm

You can create a function "muteMusic" in which you put actions to mute all your music tags. They simply use the function as one line of code to mute many different sound/music files.
ImageImage
B
27
S
16
G
68
Posts: 946
Reputation: 38,601

Post » Wed Sep 23, 2015 7:20 pm

Thank you, but either I dont understand the functions or you my problem. I need to mute music, I need to mute sound, I need certain sound stop playing, lets say "waterfall". This sound is already has a tag "sound", which mutes all sounds in game, including "waterfall" sound. When this sound is not muted and playing, I need it to stop under certain condition. I cant use Audio>Stop"tag" as it will stop all sounds with the tag "sound". And I cant use a second tag for "waterfall" sound.
B
3
Posts: 7
Reputation: 193

Post » Wed Sep 23, 2015 8:28 pm

If you need both possibility, to stop/play particular sound and stop/play some groups of sounds then you need to tag each file distinctly (each sound should have unique tag/name). With this you are allowed to stop/play a particular sound.

Now to be able to manipulate groups of sounds I would create a function in which you can put actions to stop them playing one by one. For example

Function On "stopMusic" => Audio Stop "sound_1"
Audio Stop "sound_2"
Audio Stop "sound_3"
Audio Stop "sound_X"

Or if you name it with some assumed format like above "sound_x", then you may want to do some more clever thing like:

System -> For "stopMusicLoop" from 1 to maxMusicIndex => Audio Stop "sound_" & loopindex

So I would suggest something like this. There is no way in C2 to stop/play music and sounds separately.
ImageImage
B
27
S
16
G
68
Posts: 946
Reputation: 38,601

Post » Wed Sep 23, 2015 8:47 pm

Thank you for suggestion! Seems like that should work! Ill try that tonight.
B
3
Posts: 7
Reputation: 193


Return to How do I....?

Who is online

Users browsing this forum: Darth Crusher, ketramtu18, OddConfection, XMatrix, Yahoo [Bot] and 9 guests