I have an app that uses WaveIn to record audio. It records it in chunks... to do this, it calls:
waveIn.StartRecording()
... and then after a few seconds, it calls:
waveIn.StopRecording()
Right after it calls waveIn.StopRecording(), it allocates a new WaveIn object and calls StartRecording() on it to start recording the next chunk of audio.
Is this a reasonable approach?
What I'm finding is that occassionally, this happens when calling StartRecording():
Error while starting recording: MemoryAllocationError calling waveInOpen
at NAudio.MmException.Try(MmResult result, String function)
at NAudio.Wave.WaveIn.OpenWaveInDevice()
at NAudio.Wave.WaveIn.StartRecording()
Any thoughts on how to avoid this?