2

I write the code below but I cannot change the volume of the sound. I changed "a.Volume = 5;" but this did not affect anything. How can I change the volume of the audio. Thanks

var a = new System.Windows.Media.MediaPlayer();

a.Open(new System.Uri(@"\a.wav”))

a.Volume = 5;

a.Play();
lance
  • 16,092
  • 19
  • 77
  • 136
user2569038
  • 33
  • 1
  • 8

1 Answers1

4

Volume properties accept a Double value between 0 (no sound) and 1 (maximum volume)

Martheen
  • 5,198
  • 4
  • 32
  • 55