Audio always stops halfway through the scene

I’m working on a game and I started analyzing the game’s audio in Phaser 3. The audio works well at the beginning of the scene, no lag or anything like that, with some tweens running along. However, at a certain point (usually halfway through the scene) the audio for the entire game stops and no more sounds play.

My game config:

{
      autoFocus: true,
      banner: false,
      disableContextMenu: true,
      roundPixels: true,
      audio: {
        disableWebAudio: false,
      },
      physics: {
        default: "arcade",
        arcade: {
          debug: false,
        },
      },
      render: {
        antialias: true,
        preserveDrawingBuffer: false,
        failIfMajorPerformanceCaveat: false,
        powerPreference: "high-performance",
      },
      type: Phaser.AUTO,
      fps: {
        target: 15,
      },
      plugins: {
        scene: [
          {
            key: "SpinePlugin",
            plugin: window.SpinePlugin,
            start: true,
            mapping: "spine",
          },
        ],
      },
      scale: {
        mode: Phaser.Scale.FIT,
        autoCenter: Phaser.Scale.CENTER_BOTH,
        expandParent: true,
      },
      scene: BootScene
    };

I think it’s important to say that the user only sees the execution of the tweens in this scene, they don’t take any action.

Has anyone had a similar problem?

Thanks

:wave:

Are you playing a lot of sounds, or long ones?

You can try

console.log('playing', this.sound.getAllPlaying());
console.log('all', this.sound.getAll());
1 Like