Play wav files
1 2 System.Media.SoundPlayer player = new SoundPlayer(); 3 player.SoundLocation = "c:\\test.wav"; 4 player.LoadAsync(); 5 player.PlayLooping(); //asynchronous (loop)playing in new thread 6 Thread.Sleep(5000); 7 player.Stop();
DZone Snippets > mstampar > wav
13399 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Miroslav Stampar http://mstampar.awardspace.com
1 2 System.Media.SoundPlayer player = new SoundPlayer(); 3 player.SoundLocation = "c:\\test.wav"; 4 player.LoadAsync(); 5 player.PlayLooping(); //asynchronous (loop)playing in new thread 6 Thread.Sleep(5000); 7 player.Stop();