title: C# windows forms application volume slider
body: <p>I have an application that plays a .wav file using the soundplayer, I looked it up and couldn't find a way to change the volume it plays in. What I'm looking for is either to change the volume of the file independently through the program or have a slider to change the volume of the window itself in windows volume mixer. Thanks!</p>
  
  <pre><code>public void loadSound()
  {
      sp.Load();
      sp.Play();
  }
  
  private void timer1_Tick(object sender, EventArgs e)
  {    
      if (BarTimer.Value &lt; BarTimer.Maximum)
      {
          BarTimer.Value = BarTimer.Value + 1;
      }
  
      if(BarTimer.Value==BarTimer.Maximum)
      {
          loadSound();
          timer1.Stop();
          BarTimer.Value = BarTimer.Minimum;
      }
   }
  </code></pre>