I think I took the "monitoring" from your examples.
_monProc = new STREAMPROC(MonitoringStream);
_monStream = Bass.BASS_StreamCreate(44100, 2, 0, _monProc, 0); // user = reader#
Bass.BASS_ChannelPlay(_monStream, false);
private int MonitoringStream(int handle, IntPtr buffer, int length, int user)
{
return _monBuffer.Read(buffer, length, user);
}
private bool RecordingHandler(int handle, IntPtr buffer, int length, int user)
{
// user will contain our encoding handle
if (length > 0 && buffer != IntPtr.Zero)
{
if (_IsMonitorRecorder)
{
_monBuffer.Write(buffer, length);
}
}
return true;
}