How do I avoid this error when sound loops?

0 favourites
  • 2 posts
From the Asset Store
Use this game pack to create your own game, modify the existing game or simply take a look and see how it was made.
  • At the end of the song and when music restarts (I have looping music) this error appears, I've tried everything but keeps appearing.

    I've tried to stop all sounds, silent the sound, check if sounds play with a variable and then stop and start the sound, nothing works.

    Javascript error!

    Uncaught invalidstate error: failed to execute 'creativemediaelementsource' on "Audiocontext": HTMLmediaelement already connected previously to a different Mediaelementsourcenode.

    http;//localhost:50000/Audio_plugin.js, line 1082 (col 64) This is either a bug in Construct 2 or a problem in a third party plugin or behavior - please report it to the developer

    I've tried to remove the error changing all the code, and this level 1 only plays a single sound file, the music, but I want it looping. I can't just play it once and leave the level without music, that could solve the problem though. Or, I could edit the file to make it much bigger to repeat the music in the sound file but that will be very big and make my game much bigger in size. Or, I can remove the music at all. But I really hope to be able to have some music in my game.

    Maybe i just don't know how to add it correctly?

    first I added a line that says stop all sounds when layout starts.

    Then I just added the events: "on start of layout ( plus another condition: music is not playing ) then --> play "music" looping at volume -10db (tag "music")

    I'd appreciate any help.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I found a fix for this, maybe temporary but works for me.

    If I move the sound files to the "sounds" folder instead of the "music" folder, it gives no more errors!

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