Understanding the Audio Tag

Get help using Construct 2

Post » Fri Dec 16, 2011 7:11 pm

I've read the tutorial about audio "Adding sound - a beginners guide", but what I don't understand is that one can only declare a tag for an audio file when using the Play option.
Later then all other Actions (Stop, SetLooping etc.) can use this tag.
It would be better to give the tag when importing the file, or on preloading. Here is why:

I would like to play a certain sound using variables (text) in an action like this:
Audio->Play"MySound"
However this seems not possible, I have to select the sound directly and can then give an optional tag name.

Or do I miss something?

B
33
S
7
G
6
Posts: 34
Reputation: 4,815

Post » Fri Dec 16, 2011 7:17 pm

Ashley put this on the todo list for the audio-object after i bugged him about it by creating a thread :D

So you'll be able to do this in a future version.Ize2011-12-16 19:18:09
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Mon Feb 27, 2012 11:34 pm

So sorry to bump an old thread, but was this ever fixed? I can't find this feature. My apologises if I'm being stupid and it's staring me in the face.

Also, possibly related? I'm having problem muting sound for my game. It's currently set that on collision from the ball with platforms, walls etc a sound plays. However, for every instance do I have to set the tag? For example, if the tag is set when the ball collides with the platform, will the tag carry over for when the same sound is triggered on collision with the wall?

I have tagged the sounds that play on collision as "sound" and set up an event
If Variable = 0, set "sound" muted.

But it still plays.

Anything obviously wrong here?
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Wed Feb 29, 2012 9:24 pm

Regarding the play by (string)name problem: this is fixed (added) since quite some time now, works as expected. In your action use the audio element and select the play(by name) event. The name is the one given at import time (file name).
I've never tried to mute sound, so can't help with that.
B
33
S
7
G
6
Posts: 34
Reputation: 4,815

Post » Wed Feb 29, 2012 9:51 pm

@FredQ: I take it is for a mobile game.
Was it exported using the new appmobi plugin ?
If so I think I saw in a post Ashley saying that only the "Play" action works in this configuration, no other audio command is recognized for now.

Audio support is still "hardcore" and pretty "attarded" on mobiles.

In desktop, the mute action does work (tested in FF and chrome), using it after the play action and according to the correct tag (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: 6,999
Reputation: 57,793

Post » Wed Feb 29, 2012 10:38 pm

Thanks for your responses. I did manage to get it all running, the mute works fine now. On the desktop this is though, the sound won't mute on the mobile device. However, I'm in no rush, I can wait for updates and fixes etc. I just wanted to be sure I wasn't going wrong anywhere.
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325


Return to How do I....?

Who is online

Users browsing this forum: flemmig, Matthew de, semaso, Skebab, Virpoja and 23 guests