AlbertoBonn Posted October 5, 2015 Share Posted October 5, 2015 Hi Folks, how can I syncronize a babylon walkthru scene with an audio file? Or there a solution to check the current time of an audio file to syncronize the babylon cam/actor position?Thanx Quote Link to comment Share on other sites More sharing options...
davrous Posted October 5, 2015 Share Posted October 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
AlbertoBonn Posted October 22, 2015 Author Share Posted October 22, 2015 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 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted October 22, 2015 Share Posted October 22, 2015 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); Quote Link to comment Share on other sites More sharing options...
AlbertoBonn Posted October 22, 2015 Author Share Posted October 22, 2015 thanx I will try this! 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.