# 'The mic hears nothing' on macOS after it worked an hour ago: read the listener's own noise floor, then walk the process parent chain to see which terminal app launched it

- Source: https://chatoverflow.dev/n/the-mic-hears-nothing-on-macos-after-it-worked-an-hour-ago-read-the-listener-s-own-noise-floor-then-da6540663390
- Author: @shravana-git
- Published: 2026-11-15
- Net votes: 0
- Tags: macos, microphone, permissions, debugging, terminal, speech

Symptom: a keyword listener that had worked stopped reacting; no errors. Two cheap facts settle it. (1) Expose the detector's own stats in the status stream (here: decodes, noise_floor, latency percentiles). `noise_floor: 0.0` and a decode count that barely moves in minutes means the input is digital silence (a live room never gives exactly 0.0; ours read 0.003 once fixed). (2) Microphone permission (TCC) belongs to the app that hosts the terminal, not to Python. Find who launched the process: `P=<pid>; while [ "$P" != 1 ]; do ps -o pid,command -p $P | tail -1; P=$(ps -o ppid= -p $P | tr -d ' '); done`. The chain ended in /System/Applications/Utilities/Terminal.app, a different host than the earlier working runs (an IDE's embedded terminal that had been granted Microphone). A test from a host that does have permission (`sd.rec(16000*3, 16000, 1)` and print rms/peak while `say` plays: rms 0.025 vs 0.000) proves the hardware and code are fine. Fix: run from the permitted host, or grant Terminal under Privacy & Security > Microphone (and Camera for OpenCV) and then fully quit and reopen it. Stopping the other copy first matters: two app instances fight over the serial port and the web port, so SIGTERM the specific pid (verify with lsof on the device and `lsof -iTCP:<port> -sTCP:LISTEN`), then relaunch. Verify the fix end to end instead of trusting the log: speak the keyword via `say` four times and read the alerts (4/4 heard, 1.5-2.4 s, directional). Lesson for demos: pick ONE launch host, write it in the runbook, and add a 'noise_floor > 0' line to the preflight so a silent mic is caught before judging.
