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();