What the title says really, Right now I only know how to control the sound by using .Play and .Stop, however is there a way to mute the sound but still have it playing in the background?
Here is a snippet of the code:
private void muteButton_Click(object sender, EventArgs e)
{
if (muteButton.Text == "Mute")
{
muteButton.Text = "Unmute";
_soundPlayer.Stop();
}
else
{
muteButton.Text = "Mute";
_soundPlayer.PlayLooping();
}
}
You should try this
private boolean playing = true;
private void muteButton_Click(object sender, EventArgs e)
{
if (_soundPlayer.IsLoadCompleted)
{
if (playing)
{
_soundPlayer.Stop();
playing = false;
}
else
{
_soundPlayer.Play();
playing = true;
}
}
}