[GH-ISSUE #1140] TTS: Speed slider has no effect when using a local OpenAI-compatible TTS server #566

Closed
opened 2026-10-20 17:30:15 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @etherious1804 on GitHub (May 24, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1140

Originally assigned to: @cha1latte on GitHub.

Problem

The TTS settings include a "Speed" slider (0.25–4.0) that's stored in cfg.speed. Marinara passes it to the provider as the speed parameter in /v1/audio/speech.

OpenAI's cloud TTS honors this and returns time-stretched audio. Most local OpenAI-compatible TTS servers (mlx-audio, openedai-speech, LocalAI, etc.) silently ignore the speed param and return audio at 1x speed. The slider has no audible effect, with no error to tell the user that it didn't take.

Repro

  1. Configure TTS with source: openai, baseUrl pointing at a local mlx-audio (or similar) server.
  2. Move the Speed slider to 1.5 and click Preview, or play any TTS audio in chat.
  3. Audio plays at 1.0× regardless of slider position.

Proposed fix

Apply audio.playbackRate on the HTMLAudioElement client-side when the configured source is openai AND the baseUrl is NOT api.openai.com. The browser preserves pitch by default in modern playbackRate implementations.

For real OpenAI cloud users (baseUrl includes api.openai.com), the existing server-side handling continues unchanged — applying client-side on top would double-apply (1.5 × 1.5 = 2.25×). ElevenLabs and PocketTTS are similarly left to their own provider-side handling.

Implementation

Centralized in a single helper clientSidePlaybackRate(cfg) in tts-dialogue.ts, plumbed through:

  • ttsService.speak() and ttsService.speakSequence() via a new optional playbackRate option
  • All three call sites that play TTS audio: end-of-stream autoplay (ChatArea.tsx), per-message play button (ChatMessage.tsx), and the in-settings preview (TTSConfigCard.tsx)

PR follows.

Originally created by @etherious1804 on GitHub (May 24, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1140 Originally assigned to: @cha1latte on GitHub. ### Problem The TTS settings include a "Speed" slider (0.25–4.0) that's stored in `cfg.speed`. Marinara passes it to the provider as the `speed` parameter in `/v1/audio/speech`. OpenAI's cloud TTS honors this and returns time-stretched audio. Most **local** OpenAI-compatible TTS servers (mlx-audio, openedai-speech, LocalAI, etc.) silently ignore the `speed` param and return audio at 1x speed. The slider has no audible effect, with no error to tell the user that it didn't take. ### Repro 1. Configure TTS with `source: openai`, `baseUrl` pointing at a local mlx-audio (or similar) server. 2. Move the Speed slider to 1.5 and click Preview, or play any TTS audio in chat. 3. Audio plays at 1.0× regardless of slider position. ### Proposed fix Apply `audio.playbackRate` on the HTMLAudioElement client-side when the configured source is `openai` AND the baseUrl is NOT `api.openai.com`. The browser preserves pitch by default in modern playbackRate implementations. For real OpenAI cloud users (baseUrl includes `api.openai.com`), the existing server-side handling continues unchanged — applying client-side on top would double-apply (1.5 × 1.5 = 2.25×). ElevenLabs and PocketTTS are similarly left to their own provider-side handling. ### Implementation Centralized in a single helper `clientSidePlaybackRate(cfg)` in `tts-dialogue.ts`, plumbed through: - `ttsService.speak()` and `ttsService.speakSequence()` via a new optional `playbackRate` option - All three call sites that play TTS audio: end-of-stream autoplay (`ChatArea.tsx`), per-message play button (`ChatMessage.tsx`), and the in-settings preview (`TTSConfigCard.tsx`) PR follows.
bsakaguchi 2026-10-20 17:30:15 +07:00
  • closed this issue
  • added the
    client
    bug
    labels
Author
Owner

@cha1latte commented on GitHub (May 25, 2026):

Closed in #1178

<!-- gh-comment-id:4536717421 --> @cha1latte commented on GitHub (May 25, 2026): Closed in #1178
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#566
No description provided.