I use soundeffect to play sound from byte array and all things go alright, but i cant stop playing the sound because no method called stop() in Soundeffect, how i can stop it ?
The code:
private void playFile(byte[] file)
{
try
{
if (file == null || file.Length == 0) return;
SoundEffect se = new SoundEffect(file, microphone.SampleRate, AudioChannels.Mono);
SoundEffect.MasterVolume = 0.7f;
if (stop != 1)
{
FrameworkDispatcher.Update();
se.Play();
}
else
{
//Here should stop, how !
}
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
}