Dad72 Posted November 28, 2018 Share Posted November 28, 2018 Hello, I found a bug with the sound when using multiple scenes. If you activate a scene, all the sounds of each scene is played. There should be only the sound of the scene current to play, not the other scenes. https://www.babylonjs-playground.com/#1AP18W#15 Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 28, 2018 Share Posted November 28, 2018 Actually sound is not part of the render loop and as you use autoplay, it starts playing directly even if the scene does not render (audio tag in autoplay). There is no notion of active vs idle scene in the framework. I would recommend in this case to not use autoplay. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 28, 2018 Author Share Posted November 28, 2018 What is strange is that we give a scene in the constructor Sound (). var music = new BABYLON.Sound("Violons", "sounds/violons11.wav", scene, null, { loop: true, autoplay: true }); It means that it's totally useless to inform a scene if it's playing on any scene. I think that depending on the active scene, the sounds of other scenes should be stopped automatically. Something is not normal/logic as we are filling a scene in the Sound () constructor Quote Link to comment Share on other sites More sharing options...
Sebavan Posted November 28, 2018 Share Posted November 28, 2018 It still makes sense as you can enable disable audio per scene and this is also helpful with spatial sounds There is no notion of active scene would not make real sense (you could render 2 scenes to the same canvas with view-port) it is quite tricky to know which one is active or not. Rendering is not enough as you could have a hub from a second scene rendering only every so and then. Overall I still agree there is room for improvement on this area. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.