Files
gti_radiostudio/debug_audio.py
T

26 lines
724 B
Python
Raw Normal View History

2026-04-29 16:21:44 +10:00
# debug_audio.py - save and run this
import jack
import numpy as np
import time
client = jack.Client("DebugTest")
client.activate()
in_L = client.inports.register("test_in_L")
in_R = client.inports.register("test_in_R")
@client.set_process_callback
def process(frames):
lvl_L = np.max(np.abs(in_L.get_array())) if len(in_L.get_array()) > 0 else 0
lvl_R = np.max(np.abs(in_R.get_array())) if len(in_R.get_array()) > 0 else 0
if lvl_L > 0.001 or lvl_R > 0.001:
print(f"Levels: L={lvl_L:.4f} R={lvl_R:.4f}")
print("Connect DebugTest:test_in_L/R to your audio source in qpwgraph")
print("Press Ctrl+C to stop")
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
client.deactivate()