Include/exclude audio sources to your OBS streaming/recording(Ubuntu)
I started recording me playing Euro Truck Simulator. But the music I listened to while playing caused Youtube to throw me copyright claims. Luckily there’s a way to exclude the music from being recorded/streamed. This tutorial is based on OBS studio.
- Install PulseAudio Volume Control. You can find it in Ubuntu Software.
- Find the device number of your sound output device
In terminal type:
pactl list short sinks
and look for the line that says “RUNNING” on the end of the line. You need to keep track of the number(the device number) in the first column.
3. Create a null “sink” for streaming
A sink to my understanding is an audio output device, and a null sink works like a virtual audio output. why it is called a sink though I dont know.
Type in terminal:
pactl load-module module-null-sink sink_name=SINKNAME \ sink_properties=device.description=NAME_OF_SINK
sink_name is whatever will be displayed by the command
pactl list short sinks.NAME_OF_SINK will be name displayed as your putput device in your sound settings. Replace them with whatever you like. For example:
pactl load-module module-null-sink sink_name=streamAudio \ sink_properties=device.description="stream_audio"
The terminal will return you an integer, which is the device number for the sink. Keep track of that as well.
4. Create a combined sink
To be able to listen to your music and monitor the audio being recorded at the same time, you need to create a combined sink.
pactl load-module module-combine-sink slaves=<number1>,<number2>
number2with the device number of your actual output device and the null sink number.
5. Configure audio output device
While your game is running, open PulseAudio Volume Control. In Playback tab, find your game application, click the button on the right to choose the output device:
i. Combined sink: if you want to hear it and also stream it(the game)
ii. Your speaker: if you want to hear it but not stream it(the music)
iii. Null sink: if you want to ONLY stream it but not hearing it(the game)
6. Configure stream/recording audio output
Go to OBS
settings on the bottom right ->
Desktop Audio choose
stream_audio. Now only the ingame audio will be included in your stream.
After that you are good to go. Your stream will only include ingame audio, while you can also enjoy your music.
If your messed up somewhere in the middle, and need to remove a sink:
i. Type in terminal
pacmd list-sinks, look for the sink you wish to remove and keep track of the
ii. Remove the sink using command
pactl unload-module NUMBER. Replace NUMBER with module number from the previous step.