I know a lot of trians here record/stream gameplay while using teamspeak or discord. Personally, I only do YT VODs and I don't like having voices in my videos. So here's how you can use discord while in-game, but only record the in-game audio.
Open Broadcaster Software (OBS, I will be using this in the guide.)
Virtual Audio Cable (VAC)
After installing VAC, run "vcctlpan.exe" control panel as administrator.
On the screen that pops up, set cable to 2. This is all you have to do here, you can close it after.
Right click the sound icon, and click recording devices.
From here, you need to check "Listen to this device" and your default speaker/headphone for Line1 and Line2.
And then set line 1 as the default under playback.
In discord (pictured) or teamspeak, set the default input device to Line 2.
And then in OBS, set the desktop audio device to Line 1.
And you're all set.
How does this work?
Gameplay audio will be played through Line 1, and all voice chat will be played through Line 2. OBS will only record Line 1.
I believe you can do the same with music using a third VAC line.
Thanks for reading.