1. Click on your form. Then right-click in the Toolbox and select choose items.

text

  1. Select the tab COM Components. Then check the option Windows Media Player.

text

  1. At the top of your form import the required library by typing using WMPLib below the other libraries.

text

  1. Copy your .MP3 file into your bin/debug/net${dotnet-version} folder.
  2. Where every you want to play the sound use the following code but replace DiscoTrack.mp3 with your sound file.
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();

wplayer.URL = "DiscoTrack.mp3";
wplayer.controls.play();