How can I stop the same sound from overlapping, thus multiplying its volume?

  • Example: 3 enemies cast the same spell at the same time with the same sound. Sounds in Construct overlap, so what you perceive is 1 sound playing at 3x volume.

    I made a feature request to resolve this almost a year ago that, surprisingly, got no feedback at all. Do people just not notice this in their own games?

    construct3.ideas.aha.io/ideas/C3-I-439

    I've tried doing it myself with the "stop tag" action, but it doesn't really work. It just delays the stacked sound by 1 tick so not only is it just as loud but you also get a quick repeat at the beginning.

    Ashley Sorry to tag but this is a really common problem that affects all Construct games and was hoping you could give your input.

  • Is playing "tag", (do nothing)

    Else, play "tag"

  • But if you need them to sound every time a spell is cast then you can play them at lower volume, so even if they trigger at the same time it won't be too loud.

    More advanced option would keep track of that sound's volume and then use newt's example, but instead of do nothing if the sound is already playing play it as current volume - 5 or something like that.

  • newt Tried that and many other variations. Doesn't work. Only thing that (sort of) works is muting:

    But even then, it requires functions and I sacrifice the tag.

    Ashley would be great if we could just have an extra parameter on "Play Sound" to not allow it to overlap/stack. There doesn't seem to be a good workaround that doesn't require a function and sacrificing the tag just to check if it's a non-stacking sound.

  • Tried that and many other variations. Doesn't work. Only thing that (sort of) works is this:

    But even then, it requires functions and I sacrifice the tag.

    remove the functions man

    and use only

    audio_plugin is tag "not overlapping" playing A: play audio "not overlapping"

    audio_plugin is tag "not overlapping" playing x inverted A: play audio "newtag"

    also in your picture, the audio playing tag "" is empty...

  • That doesn't work. Like in my original post "It just delays the stacked sound by 1 tick so not only is it just as loud but you also get a quick repeat at the beginning."

    Don't get me wrong but you guys act as if I haven't actually tried these things already when I clearly said so in the first post.

    The tag is empty in the 2nd action because it's not an overlapping sound. By sacrificing the tag I meant I can't have no overlap AND a tag for other uses. It's one or the other.

  • Only playing if "Is tag playing" is not true should cover this. I don't understand why it wouldn't work, it should do. Maybe file a bug if that doesn't work?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • On collision with object

    If "spellSound" Not playing > Audio > play "spellSound"

    Or do this:

    Set some soundvolume global variable, lets say -5

    On collision with object

    If "spellSound" Not playing > Audio > play "spellSound" at soundvolume db

    If "spellSound" IS playing > Audio > play "spellSound" at soundVolume - 5 db

  • I'll put together a .c3p with the various methods on this thread and file a bug report. In theory every one of them should work in their own way but after extensive testing they all have issues. The result is usually instead of multiple sounds playing on the same tick and multiplying volume, they repeat extremely quickly which gives the same effect. A simple option to decide whether or not a played sound should stack would circumvent all this but doesn't look like that's happening.

  • BTW if you're only using the C3 runtime, this bug fix in r133 is probably relevant:

    C3 runtime: playing audio now immediately counts it as playing as it did in the C2 runtime (previously there was a short delay before 'Is playing' became true)

  • The compressor effect can be used to keep multiple sounds from getting loud. Works well in my tests. I just used the default values. Just throwing that out there as another idea.

  • That doesn't work. Like in my original post "It just delays the stacked sound by 1 tick so not only is it just as loud but you also get a quick repeat at the beginning."

    Don't get me wrong but you guys act as if I haven't actually tried these things already when I clearly said so in the first post.

    We understand what is going on based on what you are saying and showing in the image, the thing is, it should work based on the functions you shown, unless somewhere in your coding there is a wait N seconds that delays the event or the function call is looping and the condition is always true on overlapping sound.

    also the function parameter 2 not equal to "tag" has no purpose there as the function you are using has no higher or secondary condition/action that gives it that parameter. Unless you set it in another action somewhere we can't see as the image shown is cropped.

    when i sounded a bit harsh saying remove the functions i meant that one in the 2nd subevent, in case is missing the value requested there.

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