話題(スレッド) Simple Tip on synchronize motion and music のメッセージ

Simple Tip on synchronize motion and music (2012-08-18 08:28, urz9999, #65109)

Hi, just want to share a tip that can be useful to those who want to play music with motion in xna regardless of FPS loss.

First we must create a new class variable of type TimeStamp:

TimeStamp oldTime = new TimeStamp();

than in the update method we update the MMDXCore.Instance like this:

TimeSpan up = MediaPlayer.PlayPosition.Subtract(oldTime);
oldTime = MediaPlayer.PlayPosition;
MMDXCore.Instance.Update((float)up.TotalSeconds);

This way the motion remains always on synch as the music progresses.

Hope this could be useful for others as well.
As always thanks for you work.

Alessandro

話題(スレッド)

Simple Tip on synchronize motion and music (2012-08-18 08:28, urz9999, #65109)
RE: Simple Tip on synchronize motion and music (2012-08-23 11:27, wilfrem, #65214)
RE: Simple Tip on synchronize motion and music (2012-08-23 18:28, urz9999, #65222)
RE: Simple Tip on synchronize motion and music (2012-08-23 18:42, wilfrem, #65223)
RE: Simple Tip on synchronize motion and music (2012-08-23 18:53, urz9999, #65224)