Skip to content

feat(tts): add speed support for Edge TTS, OpenAI TTS, and MiniMax global fallback - #8666

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-b84516ee
Apr 12, 2026
Merged

feat(tts): add speed support for Edge TTS, OpenAI TTS, and MiniMax global fallback#8666
teknium1 merged 2 commits into
mainfrom
hermes/hermes-b84516ee

Conversation

@teknium1

Copy link
Copy Markdown
Collaborator

Summary

Salvage of PR #7378 by @0xbyt4 — cherry-picked onto current main with fixes.

Adds a speed config parameter for TTS providers. Users set tts.speed: 1.5 in config.yaml for a global default, or override per-provider with tts.edge.speed, tts.openai.speed, etc.

Changes from original PR

  1. Fixed config precedence — provider-specific speed now correctly overrides global (original had it backwards)
  2. Wired MiniMax into global fallback — MiniMax previously only read tts.minimax.speed; now falls back to tts.speed like Edge and OpenAI
  3. Added 12 regression tests covering precedence, defaults, Edge SSML rate conversion, and OpenAI clamping

Config example

tts:
  provider: edge
  speed: 1.5           # global default
  edge:
    speed: 2.0         # overrides global for Edge only

Provider details

  • Edge TTS: converts speed float to SSML prosody rate (+50%, -25%, etc.)
  • OpenAI TTS: passes speed param clamped to 0.25–4.0
  • MiniMax: passes speed in voice_setting payload

Test plan

tests/tools/test_tts_speed.py — 12 passed
tests/tools/test_tts_mistral.py — 17 passed (no regression)

Closes #7378 — credit to @0xbyt4 for the original implementation.

0xbyt4 and others added 2 commits April 12, 2026 16:44
Read tts.speed (global) or tts.<provider>.speed (provider-specific) from
config. Provider-specific takes precedence over global.

- Edge TTS: converts speed float to SSML prosody rate string
- OpenAI TTS: passes speed param clamped to 0.25-4.0
- MiniMax: wired into global tts.speed fallback for consistency

Co-authored-by: 0xbyt4 <0xbyt4@users.noreply.github.com>
12 tests covering:
- Provider-specific speed overrides global speed
- Global speed used as fallback
- Default (no speed) preserves existing behavior
- Edge SSML rate string conversion (positive/negative)
- OpenAI speed clamping to 0.25-4.0 range
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Risk Detected

This PR contains patterns commonly associated with supply chain attacks. This does not mean the PR is malicious — but these patterns require careful human review before merging.

⚠️ WARNING: base64 encoding/decoding detected

Base64 has legitimate uses (images, JWT, etc.) but is also commonly used to obfuscate malicious payloads. Verify the usage is appropriate.

Matches (first 20):

205:+            aes_key_b64=base64.b64encode(aes_key).decode("ascii"),

Automated scan triggered by supply-chain-audit. If this is a false positive, a maintainer can approve after manual review.

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.

2 participants