[PR #3721] [CLOSED] Add configurable pauses between TTS dialogue lines #6073

Closed
opened 2026-10-23 04:06:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3721
Author: @KeKKERUUU
Created: 7/16/2026
Status: ❌ Closed

Base: staging ← Head: fix/tts-dialogue-pause


📝 Commits (1)

  • bd9eaea Add configurable pauses between TTS dialogue lines

📊 Changes

5 files changed (+122 additions, -10 deletions)

View changed files

📝 packages/client/src/components/panels/settings/TTSConfigCard.tsx (+27 -0)
📝 packages/client/src/lib/tts-dialogue.ts (+11 -6)
📝 packages/client/src/lib/tts-service.ts (+51 -4)
📝 packages/shared/src/types/tts.ts (+1 -0)
📝 scripts/regressions/tts-source-persistence.regression.ts (+32 -0)

📄 Description

Linked issue

Closes #3718.

Why this change

When Only read dialogues is enabled, separate dialogue lines from the same message are played immediately one after another.

Because the TTS sequence currently starts the next generated clip as soon as the previous clip ends, conversations with multiple dialogue lines can sound unnaturally continuous.

What changed

  • Added a persisted dialoguePauseMs TTS setting.
  • Added a configurable delay from 0 to 1500 milliseconds.
  • Set the default delay to 300 milliseconds.
  • Added a delay slider below Only read dialogues in the TTS settings panel.
  • Preserved dialogue utterance boundaries during TTS request construction.
  • Applied the delay only after the final chunk of each utterance.
  • Avoided pauses between chunks belonging to the same long utterance.
  • Added abort support so stopping TTS during a delay prevents the next clip from starting.
  • Applied the behavior to both progressive and non-progressive sequence playback.

User impact

Users can control the pacing between separate dialogue lines without affecting normal full-message TTS playback.

The selected delay is saved with the existing TTS configuration and applies to newly started playback.

Technical notes

The delay is playback metadata and is not included in generated-audio cache keys.

Audio generation may continue progressively during the delay, but playback waits for the configured interval before starting the next clip.

Manual playback and autoplay already use buildTTSVoiceRequests() with speakSequence(), so no call-site changes were required.

Validation

  • TTS regression script: passed.
  • Client TypeScript and production build: passed.
  • Shared and server TypeScript checks: passed.
  • Client ESLint: passed.
  • git diff --check: passed.

The exact pnpm regression:tts and pnpm lint wrappers were attempted, but the Codex pnpm runtime stopped during its automatic install step because third-party dependency build scripts are not approved. The same underlying build, regression, TypeScript, and ESLint commands were run directly with the installed workspace binaries and passed.

Manual verification

  • Verify the slider is shown only while Only read dialogues is enabled.
  • Verify the slider range is 0–1500 ms with 50 ms steps.
  • Verify pauses in progressive and non-progressive playback.
  • Verify stopping playback during a pause prevents the next clip from starting.
  • Verify the settings panel in light and dark themes.

UI evidence

A screenshot of the TTS settings panel still needs to be added before marking this PR ready for review.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/3721 **Author:** [@KeKKERUUU](https://github.com/KeKKERUUU) **Created:** 7/16/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `fix/tts-dialogue-pause` --- ### 📝 Commits (1) - [`bd9eaea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bd9eaeace396668a6229bc2583f60a7a051a5de9) Add configurable pauses between TTS dialogue lines ### 📊 Changes **5 files changed** (+122 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/panels/settings/TTSConfigCard.tsx` (+27 -0) 📝 `packages/client/src/lib/tts-dialogue.ts` (+11 -6) 📝 `packages/client/src/lib/tts-service.ts` (+51 -4) 📝 `packages/shared/src/types/tts.ts` (+1 -0) 📝 `scripts/regressions/tts-source-persistence.regression.ts` (+32 -0) </details> ### 📄 Description ## Linked issue Closes #3718. ## Why this change When **Only read dialogues** is enabled, separate dialogue lines from the same message are played immediately one after another. Because the TTS sequence currently starts the next generated clip as soon as the previous clip ends, conversations with multiple dialogue lines can sound unnaturally continuous. ## What changed - Added a persisted `dialoguePauseMs` TTS setting. - Added a configurable delay from `0` to `1500` milliseconds. - Set the default delay to `300` milliseconds. - Added a delay slider below **Only read dialogues** in the TTS settings panel. - Preserved dialogue utterance boundaries during TTS request construction. - Applied the delay only after the final chunk of each utterance. - Avoided pauses between chunks belonging to the same long utterance. - Added abort support so stopping TTS during a delay prevents the next clip from starting. - Applied the behavior to both progressive and non-progressive sequence playback. ## User impact Users can control the pacing between separate dialogue lines without affecting normal full-message TTS playback. The selected delay is saved with the existing TTS configuration and applies to newly started playback. ## Technical notes The delay is playback metadata and is not included in generated-audio cache keys. Audio generation may continue progressively during the delay, but playback waits for the configured interval before starting the next clip. Manual playback and autoplay already use `buildTTSVoiceRequests()` with `speakSequence()`, so no call-site changes were required. ## Validation - TTS regression script: passed. - Client TypeScript and production build: passed. - Shared and server TypeScript checks: passed. - Client ESLint: passed. - `git diff --check`: passed. The exact `pnpm regression:tts` and `pnpm lint` wrappers were attempted, but the Codex pnpm runtime stopped during its automatic install step because third-party dependency build scripts are not approved. The same underlying build, regression, TypeScript, and ESLint commands were run directly with the installed workspace binaries and passed. ## Manual verification - [ ] Verify the slider is shown only while **Only read dialogues** is enabled. - [ ] Verify the slider range is `0–1500 ms` with `50 ms` steps. - [ ] Verify pauses in progressive and non-progressive playback. - [ ] Verify stopping playback during a pause prevents the next clip from starting. - [ ] Verify the settings panel in light and dark themes. ## UI evidence A screenshot of the TTS settings panel still needs to be added before marking this PR ready for review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:06:51 +07:00
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#6073
No description provided.