play.py: spectrum above controls, progress below

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 01:30:44 -04:00
parent 72ab3c7949
commit 387fcfb3d7
+5 -4
View File
@@ -288,10 +288,10 @@ def play_audio(buf, sample_rate, title="", info_lines=None, offset_sec=0.0):
if info_lines:
for line in info_lines:
print(f" {line}")
print()
print() # scope line
print() # blank
print(" [+/f] +5s [-/s] -5s [d] +30s [a] -30s [space] pause [n] next [p] prev [q] quit")
print()
print() # scope line + progress line
print() # progress line
stream = sd.OutputStream(
samplerate=sample_rate,
@@ -363,7 +363,8 @@ def play_audio(buf, sample_rate, title="", info_lines=None, offset_sec=0.0):
else:
scope = "\033[90m" + "" * scope_w + "\033[0m"
sys.stderr.write(f"\033[2A\r {scope} \r\n\n\r {icon} {cur_m}:{cur_s:02d} / {tot_m}:{tot_s:02d} {bar} ")
# Draw: move up 3 lines, write scope, skip controls line, write progress
sys.stderr.write(f"\033[3A\r {scope} \r\n\n\n\r {icon} {cur_m}:{cur_s:02d} / {tot_m}:{tot_s:02d} {bar} ")
sys.stderr.flush()
# Non-blocking single char read