Skip to content

fix(kokoro): handle new {id,name} voices shape from Kokoro-FastAPI v0.4.0#75

Open
remsky wants to merge 1 commit into
cosin2077:mainfrom
remsky:fix/kokoro-voices-object-shape
Open

fix(kokoro): handle new {id,name} voices shape from Kokoro-FastAPI v0.4.0#75
remsky wants to merge 1 commit into
cosin2077:mainfrom
remsky:fix/kokoro-voices-object-shape

Conversation

@remsky
Copy link
Copy Markdown

@remsky remsky commented May 25, 2026

Heads up: Kokoro-FastAPI v0.4.0 changed the /v1/audio/voices response shape.

Items in the voices array changed from plain strings to {"id","name"} objects (remsky/Kokoro-FastAPI#462). getVoiceOptions in packages/backend/src/tts/engines/kokoroTts.ts:99 types and returns string[], so against v0.4.0 callers receive [{id, name}, ...] typed as strings, which breaks downstream voice pickers.

This patch widens the type and normalizes both shapes to a string[] of ids (filtering empties for safety), keeping the existing contract. Users can also pass ?legacy=true server-side to keep the old shape if they'd prefer not to update the client.

Kokoro-FastAPI v0.4.0 (PR #462) changed items in the `voices` array from plain strings to `{"id","name"}` objects. `getVoiceOptions` returned the raw array typed as string[], handing dicts to callers that expect ids. Normalize so easyVoice works against old and new servers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant