Open mocabe opened 5 years ago
Dummy
, ALSA
and CoreAudio
don't even read it so this shouldn't cause any problem.
Only WASAPI
reads it when opening outstream and set the value as a name of stream.
Tests and examples working fine as far as I've tested on WASAPI
.
Edit: probably need to work on instream too.
done.
If the process already has an audio output stream open, just leave it alone. You are overwriting the existing name in Volume Mixer. For example, plugins for games should not replace the name of the game to SoundIoOutStream
just because the plugin plays a sound effect when the game is already playing background music. Worse is that it doesn't restore the name when the stream is closed while other streams are still open.
@wegylexy Yeah, that might be more desirable behaviour for WASAPI, although API is not clear on behaviour iirc. Anyway, this library is pretty much unmaintained, so I will not spend more time on this PR at this point.
I think I better use Chromium or Electron for cross-platform audio.
Even though the document of
SoundIoOutStream::name
says it defaults to"SoundIoOutStream"
, some backends do not initialize it aftersoundio_outstream_open
and leave itNULL
if user does not provide optional value for it.Currently,
JACK
andPulseAudio
properly initialize it.Dummy
,ALSA
andCoreAudio
don't.WASAPI
also does not initialize it and has null check for it.This PR makes it always be initialized by default value on all backends.