Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Waveform generation failing when using "no sound" device #5310

Merged
merged 2 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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