gap9269 / SDDSound

0 stars 0 forks source link

DJ booth #261

Open ghost opened 8 years ago

ghost commented 8 years ago
ghost commented 7 years ago

This is basically how i did it

using a sync event will set the object's syncPlayingID to whatever event was just posted so you can find it later

       WwiseObject.PostMusicSyncEvent_Bar("beethoven_nonsense_play");
       musicPlayingID = WwiseObject.syncPlayingID;

       //ping wwise to figure out where we are in the song, musicPlayingID has to be acquired first
       WwiseSharpMusicInfo musicInfo = WwiseObject.GetPlayingSegmentInfo(musicPlayingID);

        //we are in the main loop, not the intro
       if (musicInfo.activeDuration > 50000u)
       {
          WwiseObject2.PostEvent("object_dj_booth_test");
          WwiseObject2.Seek("object_dj_booth_test", musicInfo.currentPosition);
        }

        //we are in the intro, wait until the loop starts
        else
        {
            //how much longer until the loop starts, in milliseconds
            //figure out timer stuff yourself, i just used a system stopwatch + checked every frame
            timer = (long)(musicInfo.activeDuration - musicInfo.currentPosition);

            stopwatch.Restart();
        }