title: MediaPlayer.Volume control
body: <p>I have a slider where I get a value from 0 to 100 to adjust the volume. The MediaPlayer.Volume expects a value between 0.0 and 1.0 while 0=-96db and 1=-0db. Currently I use the following code to adjust the linear values from my slider:</p>
  
  <pre><code> float newVolume = (float)(Math.Sqrt(sliderValue) / 10);
   newVolume = MathHelper.Clamp(newVolume, 0.0001f, 1.0f);
   MediaPlayer.Volume = newVolume;
  </code></pre>
  
  <p>This works better then directly mapping the 0 to 100 values but in the higher half the adjustment is still rather low compared to the lower half. Are there any better solutions?</p>