Here is the code for using PlaybackStopped event, in a buttonPlayClicked event:
wfr = new NAudio.Wave.WaveFileReader(this.outputFilename);
audioOutput = new DirectSoundOut();
WaveChannel32 wc = new NAudio.Wave.WaveChannel32(wfr);
audioOutput.Init(wc);
audioOutput.PlaybackStopped += new EventHandler<StoppedEventArgs>(audioOutput_PlaybackStopped);
audioOutput.Play();
I noticed that PlaybackStopped event is not triggered when playback completed, unless I calling audioOutput.Stop() method.
This issue apply to DirectSoundOut/wavout.
I am using windows 7 64bits, VS2010, tested on standard wave file, please check out attachments for details.
Thanks.
wfr = new NAudio.Wave.WaveFileReader(this.outputFilename);
audioOutput = new DirectSoundOut();
WaveChannel32 wc = new NAudio.Wave.WaveChannel32(wfr);
audioOutput.Init(wc);
audioOutput.PlaybackStopped += new EventHandler<StoppedEventArgs>(audioOutput_PlaybackStopped);
audioOutput.Play();
I noticed that PlaybackStopped event is not triggered when playback completed, unless I calling audioOutput.Stop() method.
This issue apply to DirectSoundOut/wavout.
I am using windows 7 64bits, VS2010, tested on standard wave file, please check out attachments for details.
Thanks.