Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#!/usr/bin/env python3
import time, math, threading, struct, sys, os.path, random
import obswebsocket, obswebsocket.requests
client = obswebsocket.obsws("localhost", 4444)
source_patterns = [
sources =
audio_sources = [source["name"] for source in sources if any(i in source["name"] for i in source_patterns)]
while True:
#time.sleep(random.uniform(0, 0.1))
source = random.choice(audio_sources)
mode = random.choice(("monitorAndOutput", "monitorOnly", "none"))
x =, mode))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment