0

I want to add sound effects to my Visual C# program. What's the simplest way to do this?

This what I wrote and did not work. The sound is in Desktop and I copy also to visual studio and is didnt word. What I tried do is when I click will be sound effect

private void ShipDown(object sender, MouseButtonEventArgs e)
{
    isPress = true;    
    using (SoundPlayer player = new SoundPlayer("Sound\\mg42.wav"))
    {    
        player.PlaySync();
    }

}
Muhammad Umar
  • 3,761
  • 1
  • 24
  • 36
ghivxgrv
  • 1
  • 3

1 Answers1

0

check the path "Sound\mg42.wav" you can put mg42.wav and your exe in the same directiony, then pass "mg42.wav".

ps: double click your exe, don't run it through vs.

tim
  • 121
  • 4