Jump to content

same sound attached to multiple mesh


MarianG
 Share

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

I'm happy to hear that. 

 

And about babylon loader, and multiple sound load.  :D

 

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 :D  

Link to comment
Share on other sites

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. 

Link to comment
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...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...