Autoconnect to system ports and a start script

This commit is contained in:
media
2025-06-28 23:30:34 -05:00
parent ef5a328cdb
commit 9fcadcd1cd
3116 changed files with 658349 additions and 3 deletions
+11 -3
View File
@@ -33,8 +33,8 @@ def fetch_samples():
def process(frames):
global buffer
fetch_samples()
# print(f"[DEBUG] Buffer shape: {buffer.shape}, need: {frames}")
needed = frames
if buffer.shape[1] >= needed:
chunk = buffer[:, :needed]
buffer = buffer[:, needed:]
@@ -48,9 +48,17 @@ def process(frames):
out_r.get_array()[:] = chunk[1]
with client:
print(f"Receving on UDP port {PORT} and playing via JACK")
# === Auto-connect to system playback ports ===
try:
client.connect(out_l, "system:playback_1")
client.connect(out_r, "system:playback_2")
print("Connected to system playback.")
except jack.JackError as e:
print(f"Could not connect to system playback: {e}")
print(f"Receiving on UDP port {PORT} and playing via JACK")
try:
while True:
time.sleep(0.1)
except KeyboardInterrupt:
print("Exiting...")
print("Exiting...")