Created
December 10, 2020 10:52
-
-
Save marcan/ac89490843389ee0919f2a56c9f5ff3a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import time, math, threading, struct, sys, os.path, random | |
| import obswebsocket, obswebsocket.requests | |
| client = obswebsocket.obsws("localhost", 4444) | |
| client.connect() | |
| source_patterns = [ | |
| "RTMP", "JACK", "AUX" | |
| ] | |
| sources = client.call(obswebsocket.requests.GetCurrentScene()).getSources() | |
| 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 = client.call(obswebsocket.requests.SetAudioMonitorType(source, mode)) | |
| print(x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment