@Ian
So I've minimized the code for recording so now it looks like this:
public override bool Initialise() {
BassNet.Registration("------------------@--------.com", "-------------------");
_myRecProc = new RECORDPROC(MyRecording);
Bass.BASS_RecordInit(-1);
if (handle == 0) handle = Bass.BASS_RecordStart(recordFrequency, 1, BASSFlag.BASS_RECORD_PAUSE | BASSFlag.BASS_SAMPLE_MONO, 10, _myRecProc, IntPtr.Zero);
_recbuffer = null;
continueRecording = true;
return Bass.BASS_ChannelPlay(handle, true);
init = true;
return true;
}
public override bool StopInput() {
continueRecording = false;
return true;
}
private bool MyRecording(int handle, IntPtr buffer, int length, IntPtr user) {
return continueRecording;
}
However the application still crashes when the recording is stopped. I've also done another build where the callback function for the recording is set to null so that MyRecording is not called at all and this time when stopped it does not crash!!!