Understanding the Audio Tag

0 favourites
  • 6 posts
From the Asset Store
100+ Musical High Quality Sound Effects for your game!
  • 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?

  • 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.

  • 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?

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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).

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)