Hi Mark,
I have a problem with start/stop playing recording.
I have to play a sample which have to be recorded to disk every time it is played because it could be set with different volume level. I do the following:
Play recording:
recorder = new WaveRecorder(file, recordingFileName);
playbackDevice.Init(recorder);
playbackDevice.Play();
Stop playing:
playbackDevice.Stop();
The problem is that if the user press start/stop several times in a hurry. the following error occurred:
NAudio.MmException: AlreadyAllocated calling waveOutOpen
I know that I must avoid Init() waveOut every time I play but I have to do the recording every time because I need it for later use.
How can I properly release these objects when stop playing?