feat(dictate): add voice-reactive listening waveform

This commit is contained in:
jb
2026-08-26 13:40:47 -04:00
parent e234468a73
commit d1a811a5c5
16 changed files with 383 additions and 73 deletions
@@ -0,0 +1,27 @@
# Stream bounded audio levels for the dictate indicator
Date: 26AUG2026
Status: Accepted
## Context
Pi Dictate previously exposed only static service states. Active recording was easy to miss, and the extension had no signal from which to render a voice-reactive waveform. Raw microphone access must remain isolated in the host service.
## Decision
Protocol version 2 adds a `level` event while the service is listening. The recorder converts each 100 ms PCM window to a normalized logarithmic RMS level. The service sends the current scalar to the owning client at no more than 10 Hz.
The extension renders a fixed-width footer status:
```text
● listening ▁▂▄▇█▆▃▂▅▇▄▂
```
The circle uses Pi's semantic error color. Twelve block cells show recent levels as a scrolling history. Loading, stopping, and transcription remain static text.
## Consequences
- The indicator reacts to speech without granting Pi microphone access or sending PCM over the socket.
- Output remains bounded by the existing per-connection queue and frame limits.
- The extension and installed service must upgrade together because protocol version 1 clients do not understand level events.
- Recording causes at most ten footer renders and protocol events per second.