Quantcast
Channel: NAudio
Viewing all articles
Browse latest Browse all 5831

New Comment on "WAV"

$
0
0
This worked for me to play a wav file: using NAudio.Wave; ..... var soundFile = "Something.wav"; using (var wfr = new WaveFileReader(soundFile)) using (WaveChannel32 wc = new WaveChannel32(wfr) {PadWithZeroes = false}) using (var audioOutput = new DirectSoundOut()) { audioOutput.Init(wc); audioOutput.Play(); while (audioOutput.PlaybackState != PlaybackState.Stopped) { Thread.Sleep(20); } audioOutput.Stop(); } In this case, the PlaybackStopped event was raised, but I guess it's not good to count on that. This would work when running as a service on Windows 7.

Viewing all articles
Browse latest Browse all 5831

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>