Namespace Requried:
using System.Media;
And the Function:
void PlayAudioFile (string filePath)
{
SoundPlayer SoundPlayer = new SoundPlayer();
SoundPlayer.SoundLocation = filePath;
SoundPlayer.Play();
}
That's it!
using System.Media;
void PlayAudioFile (string filePath)
{
SoundPlayer SoundPlayer = new SoundPlayer();
SoundPlayer.SoundLocation = filePath;
SoundPlayer.Play();
}