1 hour and 2 dislikes, what a toxic community. I am glad gpt came out.
Anyway, I managed to use voice meeter as a fake microphone input. This way, I stream audio into a virtual cable (the one recorded by ffmpeg) and this virtual cable routes information to my actual headset -- so I can simultanously listen to it while recording it with ffmpeg. I am calling it from C++ as:
void startVideoRecording(std::string image_name) {
std::string ffmpegCommand =
"ffmpeg -f gdigrab -framerate 30 -i desktop -f dshow -i audio=\"Voicemeeter Out B1 (VB-Audio Voicemeeter VAIO)\" "
"-c:v libx264 -preset veryfast -s 640x480 -pix_fmt yuv420p -acodec aac " + image_name;
std::system(ffmpegCommand.c_str());
}