diff options
Diffstat (limited to 'CONTEXT.md')
| -rw-r--r-- | CONTEXT.md | 15 |
1 files changed, 15 insertions, 0 deletions
| @@ -32,3 +32,18 @@ holds no implementation decisions or specs (those live in `docs/adr/`). | |||
| 32 | afk). Paged at 10 entries, descending by default. | 32 | afk). Paged at 10 entries, descending by default. |
| 33 | - **Tracked guild** — the guild containing `status_channel_id`. Message counts | 33 | - **Tracked guild** — the guild containing `status_channel_id`. Message counts |
| 34 | are only tracked in this guild. | 34 | are only tracked in this guild. |
| 35 | |||
| 36 | ## TTS | ||
| 37 | |||
| 38 | - **Synthesize** — convert text to audio via local Piper TTS (ONNX model | ||
| 39 | loaded in-process via `piper-rs`). No external fallback. Output is f32 PCM | ||
| 40 | at the model's native sample rate (typically 22050 Hz mono), resampled to | ||
| 41 | 48 kHz stereo via inline linear interpolation before playback. Songbird does | ||
| 42 | not resample — playing un-resampled audio results in wrong playback speed. | ||
| 43 | - **TtsState** — struct held in poise `Data`: `OnceCell<Mutex<Piper>>` for the | ||
| 44 | model instance, `DashMap<String, (Vec<u8>, Instant)>` for the text→audio cache. | ||
| 45 | Piper loaded lazily on first TTS call. Cache keyed by full phrase string, | ||
| 46 | evicted by TTL. No Google TTS fallback. | ||
| 47 | - **Pre-generation** — on first voice event for a user, synthesize all 6 event | ||
| 48 | phrases (join/leave/deafen/undeafen/mute/unmute) with their display name and | ||
| 49 | cache them. ~120ms first time, instant after. Lazy — no startup cost. | ||
