Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
6e7cbf5
feat: implement audio backend specific audio managers
acid-chicken Aug 26, 2025
75a20f4
test: fix import on test cases
acid-chicken Aug 26, 2025
ed3c728
test: missing changes
acid-chicken Aug 26, 2025
f5a8060
style: fix nvika checks
acid-chicken Aug 26, 2025
aa20c7e
style: restore pragma
acid-chicken Aug 26, 2025
e1d6a10
fix: back audio setup logic from GameHost to Game
acid-chicken Aug 27, 2025
4fab199
fix: missing audio dispose
acid-chicken Aug 27, 2025
149fa5f
style: fix nvika checks
acid-chicken Aug 27, 2025
d6eecb3
chore: provide resolved audio backend
acid-chicken Aug 27, 2025
992a1f2
style: eof
acid-chicken Aug 27, 2025
9f09bc8
test: ensure free before init
acid-chicken Aug 27, 2025
17e9d51
docs: fix incorrect xmldoc
acid-chicken Aug 27, 2025
5923b0d
fix: incorrect default audio backend configuration
acid-chicken Aug 27, 2025
ebdba8c
docs: fix inaccurate comment
acid-chicken Aug 28, 2025
7ff5f89
fix: createAudioMixer is still outside of abstraction
acid-chicken Aug 31, 2025
c0ad700
fix: free devices on dispose
acid-chicken Aug 31, 2025
98885ba
fix: BassWasapiAudioManager wrongly reports their id instead of commo…
acid-chicken Aug 31, 2025
1d0f324
fix: audio mixers cannot switch the global mixer for destination
acid-chicken Aug 31, 2025
e6735c0
fix: free before stop
acid-chicken Sep 1, 2025
07b4727
fix: reduce the chance of encountering buffer underruns
acid-chicken Sep 4, 2025
8cece7d
chore: provide control to consumer to manage whether to use exclusive…
acid-chicken Sep 9, 2025
f6f5042
fix: exclusive bindable does not trigger device change
acid-chicken Sep 9, 2025
4bdcf09
perf: reduce time required for reinit as possible
acid-chicken Sep 12, 2025
a43da2f
chore: bring back control of exclusive mode to o!f
acid-chicken Sep 12, 2025
c347eaf
refactor: unwind namespaces for audio manager
acid-chicken Sep 12, 2025
2791d77
refactor: remove unnecessary using
acid-chicken Sep 12, 2025
fe7ac8e
refactor: remove unnecessary using
acid-chicken Sep 12, 2025
a4ff539
chore: show human-readable device name on change audio device
acid-chicken Sep 15, 2025
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
8 changes: 4 additions & 4 deletions osu.Framework.Tests/Audio/AudioManagerWithDeviceLoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace osu.Framework.Tests.Audio
/// <see cref="AudioManager"/> that can simulate the loss of a device.
/// This will NOT work without a physical audio device!
/// </summary>
internal class AudioManagerWithDeviceLoss : AudioManager
internal class AudioManagerWithDeviceLoss : BassPrimitiveAudioManager
{
public AudioManagerWithDeviceLoss(AudioThread audioThread, ResourceStore<byte[]> trackStore, ResourceStore<byte[]> sampleStore)
: base(audioThread, trackStore, sampleStore)
Expand All @@ -40,20 +40,20 @@ protected override bool InitBass(int device)
}
}

protected override bool CheckForDeviceChanges(ImmutableArray<DeviceInfo> previousDevices)
protected override bool CheckForDeviceChanges(ImmutableList<DeviceInfo> previousDevices)
{
if (simulateLoss)
return true;

return base.CheckForDeviceChanges(previousDevices);
}

protected override ImmutableArray<DeviceInfo> GetAllDevices()
protected override ImmutableList<DeviceInfo> GetAllDevices()
{
var devices = base.GetAllDevices();

if (simulateLoss)
devices = devices.Take(BASS_INTERNAL_DEVICE_COUNT).ToImmutableArray();
devices = [.. devices.Take(BASS_INTERNAL_DEVICE_COUNT)];

return devices;
}
Expand Down
3 changes: 1 addition & 2 deletions osu.Framework.Tests/Audio/BassTestComponents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using osu.Framework.Audio.Sample;
using osu.Framework.Audio.Track;
using osu.Framework.IO.Stores;
using osu.Framework.Threading;

namespace osu.Framework.Tests.Audio
{
Expand Down Expand Up @@ -42,7 +41,7 @@ public BassTestComponents(bool init = true)

public void Init()
{
AudioThread.PreloadBass();
BassAudioManager.PreloadBass();

// Initialize bass with no audio to make sure the test remains consistent even if there is no audio device.
Bass.Configure(ManagedBass.Configuration.UpdatePeriod, 5);
Expand Down
2 changes: 2 additions & 0 deletions osu.Framework.Tests/Audio/SampleBassInitTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#nullable disable

using ManagedBass;
using NUnit.Framework;
using osu.Framework.Audio.Sample;

Expand All @@ -20,6 +21,7 @@ public void Setup()
bass = new BassTestComponents(false);
sample = bass.GetSample();

bass.RunOnAudioThread(() => Bass.Free());
bass.Update();
bass.Init();
}
Expand Down
Loading
Loading