This project has moved. For the latest updates, please go here.

Playback Pause and Resume

Jul 28, 2010 at 10:46 AM

In my app, I do .wav file playback which works fine I click on my Pause button and do waveoutDevice.Pause() which works ok.
But then, when I click on the play button, I am not sure what to do: I tried currentStream.Resume() and it did not work, then I tried waveoutDevice.Play() and it did not work either...

What is the right way to implement this? What do I call and what is the sequence? Or is it a bug?

BTW, my currentStream is this:

public

AudioStream(string fileName)

{

_fileName = fileName;

WaveFileReader reader = new WaveFileReader(fileName);

<font size="2">

channelStream =

</font>new WaveChannel32(reader);<font size="2"> </font><font size="2">

muted =

</font>false;

volume = 1.0f;

}

Editor
Jul 30, 2010 at 12:26 AM

Hi Securigy,

Have you reviewed the tutorials linked from the home page?

Tutorial 2 covers how to play and pause a sample:

http://opensebj.blogspot.com/2009/03/naudio-tutorial-3-sample-properties.html

~DSebJ