Pretty good audio sync if I do say so myself :)

This commit is contained in:
watsonb8
2019-11-29 22:04:55 -05:00
parent 8bea1d03da
commit 41e853b1c6
7 changed files with 25 additions and 14 deletions

View File

@ -33,13 +33,12 @@ namespace Aurora.RemoteImpl
while (continueSync)
{
Utils.Time networkTime = Utils.TimeUtils.GetNetworkTime();
float length = PlayerService.Instance.CurrentMediaLength;
Sync sync = new Sync()
{
TrackTime = length * PlayerService.Instance.CurrentMediaPosition,
ServerTime = networkTime.DateTime.Ticks + networkTime.Elapsed.Ticks
TrackPosition = PlayerService.Instance.CurrentMediaPosition,
ServerTimeTicks = Utils.TimeUtils.GetNetworkTime().DateTime.Ticks
};
await responseStream.WriteAsync(sync);
Console.WriteLine("Sent Sync");