At least for sure on the loopback as the microphone input starts stopped in the mixer at the start point, you have to push the "talk" button to set the BASS_ChannelPlay(mchan, FALSE) and BASS_ChannelSetAttribute(mchan, BASS_ATTRIB_VOL, 1);
The current code:
BASS_SetConfig(BASS_CONFIG_REC_BUFFER, 2000);
BASS_SetConfig(BASS_CONFIG_BUFFER, 2000);
BASS_RecordSetDevice(loopback);
rchan = BASS_RecordStart(44100, 2, BASS_RECORD_PAUSE | BASS_SAMPLE_FLOAT, NULL, NULL);
BASS_RecordSetDevice(mic);
mchan = BASS_RecordStart(44100, 1, BASS_RECORD_PAUSE | BASS_SAMPLE_FLOAT, NULL, NULL);
mixer = BASS_Mixer_StreamCreate(44100, 2, BASS_MIXER_NONSTOP | BASS_MIXER_CHAN_BUFFER | BASS_SAMPLE_FLOAT);
BASS_ChannelSetAttribute(mixer, BASS_ATTRIB_BUFFER, 1); // 1 second
BASS_SetConfig(BASS_CONFIG_MIXER_BUFFER, 1000);
BASS_Mixer_StreamAddChannel(mixer, rchan, BASS_MIXER_CHAN_BUFFER);
BASS_Mixer_StreamAddChannel(mixer, mchan, BASS_MIXER_CHAN_BUFFER);
BASS_Encode_OGG_Start(mixer, command_string, BASS_ENCODE_AUTOFREE, encode_proc_cb, output_file_ptr);
BASS_ChannelSetAttribute(mixer, BASS_ATTRIB_VOL, 0); // avoid mixer output to speakers
BASS_ChannelPlay(rchan, FALSE);
BASS_ChannelPlay(mixer, FALSE);
BASS_ChannelSetAttribute(rchan, BASS_ATTRIB_VOL, 1);
Loopback can also be an input from USB card and I'm 100% sure the problem will be there, but could be wrong.
Do you see anything wrong? in theory its a simple code, just mix two sources with enough buffer (1 to 2 seconds) to avoid any sound problem even in slow computers
note: there is a IF to check if devices accept float or not and choose the flag or not