Skip to content

andreaxhearts/streaming-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

streaming-tools

Various code and utilities extending other live streaming programs for Windows and Linux.

Advanced Scene Switcher

- Sound Action -

Adds a new Macro action to Advanced Scene Switcher that will play an audio file.

Installation

Dependencies: Pydub
(+ ffmpeg or libav for non-wav files.)

pip install pydub
apt-get install ffmpeg libavcodec-extra

Download the Python script from this repository from the SceneSwitcher directory to a location on your device.

OBS menu bar with 'Tools' menu open and cursor hovering over it. This image edit has the Scripts menu item text with a blue underline.
Tools ▸ Scripts ▸ 'Add Scripts' + button ▸ adv-ss-sound.py

Click 'Scripts' in the Tools menu of OBS Studio's main window.
In the window that opens, click the plus button to add a script, then browse to the .py file you saved. OBS will load this file at startup.

OBS window for the Advanced Scene Switcher plugin, with added Macro Action 'Sound' highlighted in blue by mouse cursor.

Then just open Advanced Scene Switcher from the Tools menu from before. The new Macro action will show up as "Sound".


Usage

File:

Specify a full path to the audio file, or use the Browse button to open the file manager and locate your file of choice.

Type:

[mandatory] This tells Pydub's play method what filetype the file is. Usually this will match the file extension, so put that here. Failing to correctly provide this will generate an error.


Using a Venv:

If you are using an externally-managed environment with Python, you may need to modify the code to include the path to your Python modules.
Add in the top section, before importing Pydub:

adv-ss-sound.py
import os
import sys

home = os.path.expanduser("~")
modules = os.path.join(home, ".venv/<my-env-here>/lib/<my-py-version>/site-packages")
if modules not in sys.path:
    sys.path.append(modules)

[...]

Create a venv : python -m venv /path/to/new/virtual/environment
Activate : . ~/.venv/env/bin/activate
Installing modules : python -m pip install pip --upgrade

About

Various code and extending other live streaming programs for Windows and Linux.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages