using System.Media; using (var wavefile = Resource1.ResourceManager.GetStream("MyWavefile")) { using (var player = new SoundPlayer(wavefile )) { player.Play(); } }
Beachte, nicht jede Wavedatei kann abgespielt werden. PCM codierte Dateien werden z.B. nicht unterstützt.
Das und ander Ansätze findest du auch hier: http://stackoverflow.com/questions/1161229/how-to-use-system-media-soundplayer-to-asynchronously-play-a-sound-file
http://stackoverflow.com/questions/1161229/how-to-use-system-media-soundplayer-to-asynchronously-play-a-sound-file