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

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.