How to play WAV audio file from Resources?

Because mySoundFile is a Stream, you can take advantage of SoundPlayer‘s overloaded constructor, which accepts a Stream object:

System.IO.Stream str = Properties.Resources.mySoundFile;
System.Media.SoundPlayer snd = new System.Media.SoundPlayer(str);
snd.Play();

SoundPlayer Class Documentation (MSDN)

Leave a Comment