Every playing announcement now shows a desktop notification with its text
and, on Linux, a Cancel button (Abbrechen for German) that stops exactly
that announcement; the notification is closed when the announcement ends.
This brings back what the old talk.sh had with notify-send --action, as a
default: a long announcement can be cut short without a terminal.
Implementation: the freedesktop Notifications service on the session bus
via godbus (pure Go): one connection per process, Notify with the action
list, ActionInvoked dispatched to the announcement, CloseNotification at
the end, expire_timeout 0 so the button stays for the whole announcement.
Without a session bus the notify-send fallback shows a plain notification;
macOS and Windows show one without a button for now. queue.CancelItem(id)
cancels only the playing item. Config [notify] on_speak (default true, env
TALK_NOTIFY). `talk test --toast` now shows the real thing and waits for a
click; `talk doctor` names the service and whether it supports the button.
Config hygiene found on the way: a key written below a [table] header
belongs to that table in TOML (lang under [voice] was silently ignored).
config.Load now collects unknown keys (undecoded ones and non-language
keys under [voice.<provider>]) and `talk doctor` warns with the hint.
Tests: process test on a private dbus-daemon with a fake
org.freedesktop.Notifications service (Notify payload, cancel click aborts
the synthesis, CloseNotification), queue.CancelItem, config keys. All test
binaries point DBUS_SESSION_BUS_ADDRESS at a dead socket so no test ever
pops a notification on the developer's desktop. flake vendorHash updated
for the new dependency.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
oto-Sink bekommt eine Format-Weiche: RIFF/WAVE-PCM (osbuiltin) und MP3
(ElevenLabs/OpenAI/Edge ab Task 03). Dekoder ist github.com/hajimehoshi/
go-mp3 v0.3.4 — reines Go ohne CGO, verifiziert per GOOS/GOARCH-Matrix mit
CGO_ENABLED=0 (alle 6 Targets bauen). Der Dekoder liefert immer 16-Bit-LE
stereo (Mono-Quellen wie Edge 24 kHz werden gespiegelt); die Sample-Rate
kommt aus dem ersten Frame. Fixtures sind echte, einmalig erzeugte MP3s
(mono 24 kHz 48 kbit/s = Edge-Format, stereo 44,1 kHz = Cloud-typisch),
als Base64 eingebettet — Tests bleiben werkzeugfrei.
Sink-Vertrag Play/Name; oto-Sink (github.com/ebitengine/oto/v3, auf
v3.5.0 gepinnt — aktuelle stabile Major-Version; purego statt CGO, damit
cross-compilierbar) spielt RIFF/WAVE-PCM blockierend, ein Context pro
PCM-Format gecacht, da oto nur einen Kontext pro Prozess erlaubt.
null-Sink verwirft (CI/Server/Tests) und loggt optional. WAV-Parser
(RIFF-Chunks, PCM 8/16 Bit, Float32) mit klarer Fehler für alles andere.
Echte Wiedergabe nur hinter TALK_TEST_REAL_AUDIO=1.
Defaults → optionale config.toml → Env-Overrides (TALK_AUDIO_SINK);
Validierungsfehler sind klar, nie still. Plattform-Pfadlogik
(linux/darwin/windows, XDG_CONFIG_HOME, HOME, APPDATA) mit goos als
Parameter — alle Plattformen tischgesteuert vom Dev-Host testbar.
Erste externe Dependency: github.com/BurntSushi/toml v1.6.0 (MIT, pure Go).