예제 #1
0
        private void testPlaybackRate(double expectedRate)
        {
            const double play_time = 1000;
            const double fudge     = play_time * 0.1;

            track.Start();

            var sw = new Stopwatch();

            sw.Start();

            while (sw.ElapsedMilliseconds < play_time)
            {
                Thread.Sleep(50);
                track.Update();
            }

            sw.Stop();

            Assert.GreaterOrEqual(track.CurrentTime, sw.ElapsedMilliseconds * expectedRate - fudge);
            Assert.LessOrEqual(track.CurrentTime, sw.ElapsedMilliseconds * expectedRate + fudge);
        }
예제 #2
0
 private void updateTrack() => RunOnAudioThread(() => track.Update());