Open nightblade9 opened 4 years ago
No, it's not a bug - it's calling a Windows API that sets the volume for that output device
A better approach is to actually change the volume of the samples you are sending to that device. E.g. If your SoundEffect instance has a volume property you can set it on that.
A better approach is to actually change the volume of the samples you are sending to that device. E.g. If your SoundEffect instance has a volume property you can set it on that.
Is there a code sample for this? I thought SoundEffect
and SoundEffectInstance
don't work with OGG files. If they do, I don't know how to get that working.
SoundEffect
is not part of NAudio, so I'm afraid I don't know what it's capabilities are
My game setup:
SoundEffect.CreateInstance().Play
WaveOutEvent
for my background audioNAudio.Vorbis
to load the audio BGM fileEverything works fine. Until I try to set
Volume
onWaveOutEvent
. Bad things happen:The perception of this in-game is that changing BGM volume changes all SFX volumes, too.
You can see a tweet of this in action here: https://twitter.com/nightblade99/status/1283223485670719488/video/1
I tested it on two machines (Windows 10 and Windows 8.1) and this behaviour is the same on both machines.
How do I work around this / is it a bug? (It could be a MonoGame bug; playing multiple audio .wav files shows different issues.)