System.Media.SoundPlayer player = new System.Media.SoundPlayer(@"c:mywavfile.wav");
player.Play();
// Soundplayer only works on the Windows OS, so check if system is windows:
if (OperatingSystem.IsWindows())
{
SoundPlayer player = new SoundPlayer("song.wav");
player.Load();
player.PlayLooping();
}
System.Media.SoundPlayer player = new System.Media.SoundPlayer(@"c:mywavfile.wav");
player.Play();
//Library for using the Play() and Stop() method
using System.Media
SoundPlayer player = new System.Media.SoundPlayer(@"c:mywavfile.wav");
//Play the selected sound from the path
player.Play();