In December of 2020, OBS Studio update 26.1 was released and introduced a brand new feature: the ability to select which audio track is stored in the recording (“VOD”) of your Twitch stream. This gives streamers the power to separate audio feeds between what is broadcast live and what is stored for offline viewers. This is particularly useful for streamers who play rhythm games with copyrighted music and are looking to avoid DMCA strikes on their recorded or clipped content.

These track settings are straightforward for those that exclusively stream that sort of content, but doing these changes on the fly can be a pain for those who switch content types mid-stream. You need to open the “Advanced Audio Settings” GUI window, click the check boxes to change the selected audio tracks for the necessary sources, and then close the window.

I wrote a script to make things easier by mapping the audio track options to configurable hotkeys.

Script Setup

This script makes use of OBS Studio’s scripting interface introduced in update 21.0 which supports Python 3 and Lua scripts. The scripting menu can be accessed through the main menu bar (Tools -> Scripts).

In order to use this script you will need to have Python 3.6 installed on your system and configured in the OBS scripting settings page (Scripts -> Python Settings). As of this writing the latest version of OBS (27.1.3) has not been updated to support more recent versions of Python (3.7+). Be mindful that your Python version must match the bit depth setting of your OBS installation (“x86-64” for 64 bit OBS Studio and “x86” for 32 bit OBS Studio).

In the “Scripts” window, click the ‘+’ sign and browse to the location of the script to add it. If everything is set up properly the script properties will load on the right-hand side of the window.

Configuration

To configure the script, first choose an audio source from the drop-down list. Then select the relevant audio tracks you would like enabled in each group. Click the “Apply Track Settings” button to test applying the current track settings to the audio source. While the track settings should take immediate effect, bear in mind that in certain versions of OBS the track checkmarks in the “Advanced Audio Properties” window may not refresh. You can close and re-open the audio properties window to see the changes.

Each track group registers its own hotkey. You can find the hotkeys listed in the hotkey manager (File -> Settings -> Hotkeys). They are labeled “Track Group N for {Audio Source}”. Pressing the assigned hotkey will set the audio track assignments for the given audio source.

The script is set up to modify a single audio source with two sets of track options (‘A’ and ‘B’). Additional audio sources and track groups can be modified by importing the script multiple times.

Download

If you’d like to use it yourself, the script is open source and can be downloaded from GitHub. Have fun!


Leave a Reply

Avatar placeholder

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Would you like to know more?