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

Order of Disposing a recorder

Oct 16, 2014 at 8:59 PM
I have aquestion about the order of disposing wavein object and wavewriter objects using this object.

Which one is true and why?

void stoprecording()
{
wavewriter.Close();
wavewriter.dispose();
WaveIn.StopRecording()
WaveIn.Dispose()

}

or

void stoprecording()
{
WaveIn.StopRecording()
waveIn.Dispose();
wavewriter.Close();
wavewriter.dispose();
}

Or not important at all.

Thanks.
Oct 17, 2014 at 8:07 AM
First thing I would do is the WaveIn.StopRecording(), just to be on the safe side, the rest doesn't really matter in which order you do.