Autoconnect to system ports and a start script
This commit is contained in:
@@ -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...")
|
||||
|
||||
Reference in New Issue
Block a user