Support cartesia TTS volume - #1101
Conversation
🦋 Changeset detectedLatest commit: 01c62e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 21 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| opts.apiVersion !== API_VERSION_WITH_EXPERIMENTAL_CONTROLS || | ||
| opts.model !== MODEL_WITH_EXPERIMENTAL_CONTROLS | ||
| ) { | ||
| if (opts.speed || opts.emotion) { |
There was a problem hiding this comment.
🟡 checkGenerationConfig does not warn when volume is set on a non-sonic-3 model
In checkGenerationConfig (line 106), the else-if branch for non-sonic-3 models only checks opts.speed || opts.emotion but does not check opts.volume. This means a user who sets volume on a non-sonic-3 model (e.g., sonic-2) receives no warning, yet the volume is silently ignored in toCartesiaOptions because volume is only included in the generation_config block gated by isSonic3(opts.model) at plugins/cartesia/src/tts.ts:741. The warning condition should include opts.volume to be consistent with how the option is actually handled.
| if (opts.speed || opts.emotion) { | |
| if (opts.speed || opts.emotion || opts.volume) { |
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f238cd71e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (opts.speed) { | ||
| generationConfig.speed = opts.speed; |
There was a problem hiding this comment.
Validate sonic-3 speed before sending generation config
The new sonic-3 path forwards opts.speed directly into generation_config.speed, but speed still accepts string presets ('fast', 'slow', etc.) and the sonic-3 validation only runs for numeric values. With sonic-3 now the default model, existing callers that pass string speeds can now send invalid payloads (sonic-3 expects numeric speed in the 0.6–2.0 range), causing synthesis requests to fail without a warning.
Useful? React with 👍 / 👎.
| opts.apiVersion !== API_VERSION_WITH_EXPERIMENTAL_CONTROLS || | ||
| opts.model !== MODEL_WITH_EXPERIMENTAL_CONTROLS | ||
| ) { | ||
| if (opts.speed || opts.emotion) { |
There was a problem hiding this comment.
Warn when volume is ignored on non-sonic-3 models
checkGenerationConfig is called when volume is provided, but in the non-sonic-3 branch it only warns for speed/emotion; meanwhile toCartesiaOptions only emits generation_config.volume for sonic-3. This means setting volume on other models is silently dropped, so users get no indication that their configuration has no effect.
Useful? React with 👍 / 👎.
#1043