MarianG Posted December 11, 2015 Share Posted December 11, 2015 Hi, I have another strange question for you.Let's suppose we have 3, 4 characters with walk animation, and a walk sound. How to attack sound to all 4 characters without upload the same sound for all 4?It's possible? Or will be possible,... like a clone method? I try to simulate something http://www.babylonjs-playground.com/#UWCDG#1 Thaks a lot. Quote Link to comment Share on other sites More sharing options...
davrous Posted December 11, 2015 Share Posted December 11, 2015 Hi, Thanks for the feedback. I have indeed not think about this case. I need to work on a clone method as suggested that would avoid creating several time a new sound that would redownload the same sound (even if the browser cache will help there). Bye, David Quote Link to comment Share on other sites More sharing options...
MarianG Posted December 12, 2015 Author Share Posted December 12, 2015 Wonderfull.Thank you David Quote Link to comment Share on other sites More sharing options...
davrous Posted December 14, 2015 Share Posted December 14, 2015 I've coded it while in the plane back from Moscow. I now need to test it and launch my classical web audio unit tests on top of it before publishing it. You gave me an idea also on how to optmize our .babylon loader where the same .mp3/.wav file could be referenced multiple times in the file. So thank you for your feedback again. ;-) David Quote Link to comment Share on other sites More sharing options...
MarianG Posted December 15, 2015 Author Share Posted December 15, 2015 I'm happy to hear that. And about babylon loader, and multiple sound load. I have 9 sound, about 1mb each. And when I load scene, I load them too, and for a few seconds (3,4 seconds) my browser freeze. I think it's because I load all 9 sounds in the same time. I have to load each one in the succes callback of previous?I'm sure that it's a problem with sounds, because without sounds, the scene loads ok. Sory my english, and thanks for your help Quote Link to comment Share on other sites More sharing options...
davrous Posted December 17, 2015 Share Posted December 17, 2015 I've just upgraded slightly the web audio stack. It now supports cloning on a Sound and I've also improved the .babylon loader to avoid doing multiple requests again the same .mp3/.wav file that would be referenced in it. Here is a demo of cloning: http://www.babylonjs-playground.com/#TBJPH Simply call the clone() function and it will reuse the web audio buffer and copy/pasting all sound properties. And for instance Mansion was generating 128 network requests and now generates 124 requests thanks to this little optim also. Code is not yet in the github but you can already test it on the playground. Dad72 and MarianG 2 Quote Link to comment Share on other sites More sharing options...
MarianG Posted December 17, 2015 Author Share Posted December 17, 2015 Many thanks. Quote Link to comment Share on other sites More sharing options...
davrous Posted December 17, 2015 Share Posted December 17, 2015 Thank you for your idea and feedback 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.