Skip to content

Commit

Permalink
Merge pull request #5310 from peppy/fix-waveform-no-sound-device
Browse files Browse the repository at this point in the history
Fix `Waveform` generation failing when using "no sound" device
  • Loading branch information
frenzibyte authored Jul 18, 2022
2 parents 7fea93e + 94ff09a commit 08c4006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions osu.Framework.Tests/Visual/Drawables/TestSceneWaveform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ public void TestWaveformAlpha()
});

AddUntilStep("wait for load", () => graph.Regenerated);

AddUntilStep("wait for sampling", () => graph.Waveform.GetPoints().Count > 0);
}

private void startStop()
Expand Down Expand Up @@ -211,6 +213,7 @@ public TestWaveform(Track track, float resolution)

public Waveform Waveform
{
get => graph.Waveform;
set => graph.Waveform = value;
}

Expand Down
2 changes: 1 addition & 1 deletion osu.Framework/Audio/Track/Waveform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public Waveform(Stream data)
readTask = Task.Run(() =>
{
// for the time being, this code cannot run if there is no bass device available.
if (Bass.CurrentDevice <= 0)
if (Bass.CurrentDevice < 0)
{
Logger.Log("Failed to read waveform as no bass device is available.");
return;
Expand Down

0 comments on commit 08c4006

Please sign in to comment.