Skip to content

Commit ed67607

Browse files
committed
add comment
1 parent 56dd8c0 commit ed67607

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

osu.Framework/Threading/AudioThread.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,15 @@ internal bool InitDevice(int deviceId, bool useExperimentalWasapi)
139139
if (!Bass.Init(deviceId, Flags: (DeviceInitFlags)128)) // 128 == BASS_DEVICE_REINIT
140140
return false;
141141

142+
// Whenever one sink is started, the other needs to be stopped, so we don't end up with double playback.
143+
// We can technically get away with neglecting this (as we have in the past),
144+
// because switching the output involves creating a new global mixer that the previous output doesn't know about,
145+
// and when no audio data is provided, BASS internally pads the output with silence.
146+
// But letting the standard output keep feeding a constant stream of silence to the OS in the background feels wrong,
147+
// and it would become a problem if we ever wanted to reuse a global mixer,
148+
// because then we'd have multiple outputs pulling data from the same stream.
149+
// It is also inconsistent with the wasapi implementation, which does call Stop() explicitly,
150+
// even though we could get away with omitting that one as well
142151
if (useExperimentalWasapi)
143152
{
144153
Bass.Stop(); // halt the standard output (don't free, we still need it for DSP)

0 commit comments

Comments
 (0)