I modified the volume for my game with naudio and it is now completely muted, how do I make the sound work again?
This is the code:
private readonly WaveOutEvent Music_Output = new WaveOutEvent();
//I play the music on a timed event, you can ignore this detail;
private void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
{
UnmanagedMemoryStream sound1 = Properties.Resources.Cycle_Sort_1;
//the sound I am playing
byte[] b = ReadToEnd(sound1);
//ReadToEnd is an external bytestreaming function that is unrelated to my
//issue so you can ignore it.
WaveStream wav = new RawSourceWaveStream(new MemoryStream(b), new WaveFormat(44100, 16, 2));
Music_Output.Init(wav);
Music_Output.Volume = 0;
//THIS IS THE LINE THE BUGGED MY ENTIRE AUDIO FOR THE GAME;
//After I ran this line, the whole audio for the game is mute forever, no
//matter what I do
Music_Output.Play();
}
After that I returned the volume back to normal
private readonly WaveOutEvent Music_Output = new WaveOutEvent();
//I play the music on a timed event, you can ignore this detail;
private void OnTimedEvent(Object source, System.Timers.ElapsedEventArgs e)
{
UnmanagedMemoryStream sound1 = Properties.Resources.Cycle_Sort_1;
byte[] b = ReadToEnd(sound1);
WaveStream wav = new RawSourceWaveStream(new MemoryStream(b), new WaveFormat(44100, 16, 2));
Music_Output.Init(wav);
Music_Output.Volume = 100;
Music_Output.Play();
}
but everything is STILL MUTED for NO REASON! Can anyone help me with this weird issue?