Update speech server engine following change in controls handling - #57
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the Speech Server integration to account for speech-server moving controls from per-voice (GET /voices) to provider-level (GET /service), ensuring client-side rate handling reflects what the server actually honors.
Changes:
- Fetches
/servicealongside/voicesand maps provider-levelcontrolsonto each returnedReadiumSpeechVoice. - Updates SpeechServer TypeScript types and mapping utilities to remove per-voice
controlsand add providercontrolstoSpeechServerServiceInfo. - Adjusts tests and bumps package version + changelog entry for the fix.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/SpeechServer/testUtils.ts | Updates test voice factory to stop emitting per-voice controls by default. |
| test/SpeechServer/speechServerEngineProvider.test.ts | Updates provider tests to supply /service provider-level controls and assert merged controls on voices. |
| test/SpeechServer/speechServerEngine.test.ts | Updates engine tests to model provider-level controls during background voice resolution. |
| src/SpeechServer/types.ts | Removes controls from SpeechServerVoice and adds controls (and optional quality) to service providers. |
| src/SpeechServer/speechServerVoiceMapping.ts | Changes mapping to accept provider controls and assign them to the mapped ReadiumSpeechVoice. |
| src/SpeechServer/speechServerEngineProvider.ts | Fetches /service in getVoices() and merges provider controls into each voice. |
| src/SpeechServer/speechServerEngine.ts | Fetches service info when loading voices and merges provider controls to avoid incorrect local rate fallback. |
| package.json | Bumps version to 0.7.1. |
| CHANGELOG.md | Documents the fix and the upstream API change. |
Suppressed comments (1)
test/SpeechServer/speechServerEngine.test.ts:553
- These assertions/setVoice calls should use the documented ElevenLabs provider id segment (
elevenlabs) in the URN, to match what the speech-server actually returns/accepts.
engine.setVoice("urn:readium:tts:eleven:estelle"); // supersedes the still-pending lookup for "alba"
await flush();
t.is(engine.getCurrentVoice()?.identifier, "urn:readium:tts:eleven:estelle", "the later setVoice() call wins, not the earlier one's background resolution");
馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update covers readium/speech-server#31
Specifically, it handles the shifting from per-voice to provider-level controls.