Define the TTS engine adapter contract and registry #8
Labels
No labels
NaNs
area/audio
area/build
area/docs
area/dsh
area/engine
area/security
area/ui
needs-operator
priority/later
priority/next
priority/now
type/bug
type/task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
dsh-plugins/dsh-whale-noises#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
One small interface every engine implements, so the queue, settings and capture code never learn engine specifics.
Scope
TtsEngine(JSDoc):id,label,kind: 'local' | 'cloud',init(settings),listVoices(),prepare(voiceId, onProgress)(local only),synthesize(text, { voice, rate, signal }),dispose().synthesizeresolves{ audio: AudioBuffer }or{ pcm: Float32Array, sampleRate }; throw typed errors (EngineUnavailable,DownloadRequired,SynthesisFailed,Cancelled).active()resolution from settings with a sane fallback when the configured engine is unavailable.localStorage; settings are passed in. AbortSignal honoured at every async boundary.docs/dev-plan.md/AGENTS.md so a new engine has a checklist.Acceptance
Notes
Done in
d5c638e.src/engines/contract.js:TtsError+ four typed subclasses with stable codes,assertEngine,createEngineRegistry(register/get/list/has/resolve/disposeAll, duplicate ids rejected, stale-safe disposers, AggregateError on dispose failures); 29 tests. Contract JSDoc + a copy-ready skeleton added todocs/dev-plan.md§7.1. CI run #2 green.