jeudi 22 janvier 2015

End of playing audio file , using Naudio.dll

i'm using this code to play a wav file, but i don't know how to know when the audio file ends to do the next steps of my program. Example: When i click Play button, label Status = "Playing", and then, end of playing, label Status = "Stopped".



//using
using NAudio.Wave;

//var
WaveFileReader reader;
DirectSoundOut output;

// Play button
output = new DirectSoundOut();
reader = new WaveFileReader(@"D:\dmt.wav");
output.Init(new WaveChannel32(reader));
lab_Status.Text = "Playing...";
output.Play();


I tried to use Stop event but it didn't work. Please help me, thanks.


Aucun commentaire:

Enregistrer un commentaire