mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:17:01 +01:00
A voice is a serial channel at ~150 words a minute, and an AI voice that talks too much is the fastest way to make someone take the headphones out. This round is the art and science of that channel: - Studio voice. /api/voice/speak reads short pieces through Groq's Orpheus endpoint (lib/voice/tts.ts); lib/voice/speaker.ts cuts a briefing at sentence ends (speak-chunks, ≤200 chars), fetches one piece ahead of the one playing, decodes into the soundscape, and hands the rest to the phone's own voice on any failure (then stops asking for two minutes). Six voices + "phone" in config/no-screen.ts. - Music the phone composes (hooks/use-soundscape.ts, numbers in lib/voice/soundscape.ts): six chords in D on detuned sine+triangle pairs through a drifting low-pass and a feedback delay, nothing above F#4, level 0.09 at rest and 0.025 under the voice. No file, no licence, no stream. - Earcons: rising for finished, falling for failed, a knock for something that needs you, a blip when a take is sent, low falling/rising for the line dropping and returning. Each under 0.6 s; a test pins that. - One output: the whole graph leaves through one MediaStream that the media-session <audio> plays, so lock-screen controls and screen-off playback follow the platform's rules for a track; direct output is the fallback (and the public demo's mode). Never both. - Talk-over: while Loki speaks the analyser keeps running; a burst above 2.5× the room's bar for 350 ms cancels the voice and hands over the mic. - Fewer, better sentences (lib/voice/announce.ts, pure, tested): coalesced by kind, urgency first, two or three phrasings rotated by a counter, "details" on request, and an "only what needs me" mode that holds finished runs for one sentence every five minutes. A dropped line is said once, and once when it is back. - Settings on the start screen, kept per device (voice, music, talk-over, mode). - /no-screen: a "Hear twenty seconds of it" demo on the visitor's own phone and a section on why it is pleasant. - Essays, anyone first: a ```deep fence renders as a closed <details> (components/thoughts/DeepBlock.tsx); the fleet-in-your-ear essay is rewritten that way, style guide updated. ROADMAP + CHANGELOG. Claude-Session: https://claude.ai/code/session_01YKx4TPejLvFR9Uj4xrTf6Y Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>