Jump to content

Audio Syncro with babylon.js


AlbertoBonn
 Share

Recommended Posts

Hi,

 

 What would you like to do exactly? I'm exposing the _startTime property on the BABYLON.Sound object and you can access to the global Web Audio timer inside the Engine.audioEngine.audioContext.currentTime .

 

 So you'll have to compute it by yourself. But if I manage to understand your scenario, I can add some code for you.

 

Bye,

 

David

Link to comment
Share on other sites

  • 3 weeks later...

Ok, thanx for the very fast answer!

 

I have a song 4min long, with two important scenes, where the 3D animation should be in sync with the song. The scene before the important moments in the song, its ok when it doesnt play thru the full scene before the important moment come. Its ok when the animation jumps on this point to the important scene.

Again:

10 scenes, scene 5 and 7 must be in sync but the scene 4 and 6 the animation can jump to the important scene when its not in sync.

Thanx, Alberto

Link to comment
Share on other sites

I see internally, there is  _startOffset property, which defaults to 0.  Is set by pause() to the current spot, so that when play() is called again, it picks up where it left off.

 

Assuming no changes to API, maybe when your code jumps to a spot you wish to be in-sync:

sound.pause();sound['_startOffset'] = milliStartPoint;sound.play(0);
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...