scene.audioEnabled skips parts of sounds

Hi altogether!

I am trying to pause and resume a scene on button press for a pause menu. I figured I should be able to toggle audio playback for all sounds of a scene by setting scene.audioEnabled. On audioEnabled = false all sounds stop as expected, but playback seems to continue at random parts of the sound when I set it to true again.

Calling sound.pause() and sound.play() on a single sound file works, iterating over scene.mainSoundTrack.soundCollection as in SceneAudioComponent.enableAudio() works too.

Playground behaves the same as my local tests: Babylon.js Playground

I believe it’s supposed to work via audioEnabled and that’s why I am filing this as a bug. Hope you have any idea what is happening or where I might be wrong, thanks in advance!

1 Like

Hey, I fixed your PG to point to a real sound and it seems to work for me:
https://playground.babylonjs.com/#QQMJHF#1

@dmarku and @Deltakosh: I’m no musician,so I added a different sound file my multi-sound file. Here is the PG

I tested by hitting the “p” key then counting to 5-10 secs then hitting that “p” key again. It does seem to jump a bit …

But I have no idea why, though “scene.audioEnabled” does seem to me to be a scene property not an audio track property - but I’m no coder :grin:

cheers, gryff :slight_smile:

It jumps you are very right! Let me fix that for next nightly :slight_smile:

1 Like