Sign in to follow this  
Dad72

Multi scene with sound

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.