using System.Media; // ... SoundPlayer player = new SoundPlayer(); player.SoundLocation = "pathToFile.wav"; player.Play();
using System.Media; // ... SystemSounds.Beep.Play();This example shows how to play a system sound (in this case, the Windows default beep) using the SystemSounds class. The static Play() method is called on the Beep object to play the sound. Package library: System.Windows.Extensions