public void TestPlayPauseStop() { Assert.That(!track.IsRunning); bass.RunOnAudioThread(() => track.Start()); bass.Update(); Assert.That(track.IsRunning); bass.RunOnAudioThread(() => track.Stop()); bass.Update(); Assert.That(!track.IsRunning); bass.RunOnAudioThread(() => { track.Seek(track.Length - 1000); track.Start(); }); bass.Update(); Assert.That(() => { bass.Update(); return(!track.IsRunning); }, Is.True.After(3000)); }
private void startStop() { if (track.IsRunning) { track.Stop(); button.Text = "Start"; } else { track.Start(); button.Text = "Stop"; } }
public void play(BeatmapInfo Beatmap, BeatmapDatabase Database) { using (var reader = Database.GetReader(Beatmap.BeatmapSet)) using (var file = reader.GetStream(Beatmap.Metadata?.AudioFile ?? Beatmap.BeatmapSet.Metadata.AudioFile)) { MemoryStream ms = new MemoryStream(); file.CopyTo(ms); System.Diagnostics.Debug.Print("Loaded file of size {0}", ms.Length); Track track = new TrackBass(ms); Audio.Track.SetExclusive(track); track.Start(); } }
private void load(AudioManager audio, Game game) { AddStep("Play track", () => { Track = new TrackBass(game.Resources.GetStream("Tracks/" + TestLevel.Metadata.Level.LevelName + "/" + TestLevel.SongUrl)); audio.AddItem(Track); Track.Start(); }); AddStep("Stop track", () => { Track.Stop(); Track.Seek(0); }); }
public void TestIsRunningUpdatedAfterInlineStart() { bass.RunOnAudioThread(() => track.Start()); Assert.That(track.IsRunning, Is.True); }