What I used to have on windows was I had a virtual audio device with the virtual audio cable program. I set the audio output of OBS studio and the audio output of whatever game I play to that virtual sound device and then whatever goes through that sound device is looped back to my real audio output with the virtual audio cable program. This way OBS Studio will only stream the audio of the game I play, and I can hear the game's audio too.
How can I do that on linux? I tried to do it with jack and jack2 but I could not figure out how to add a virtual sound device and loop back the audio from it to my real audio output. I tried to do with pulseaudio too but I only managed to loop back my microphone input to my audio output.
I am not very experienced in this matter. Also pulseaudio is a must for me. So, however it is done, it must be done in a way that it works with pulseaudio.