I\'m writing a Console application on C# and I want to play a sound when I display texts continuously. This is what I\'ve done :
static SoundPlayer typewrite
If for example you have your sounds in the folder "Assets" then subfolder "SoundClips" do it like this.
var soundLocation = Environment.CurrentDirectory + @"\Assets\SoundClips\";
SoundPlayer player = new SoundPlayer
{
SoundLocation = soundLocation + "typewriter.wav",
};
Make sure you have the file properties set to:
build action - Content
copy to output directory - Copy if newer