[PR #2648] [MERGED] Fix game-mode voice auto-play overlap (#2647) #5706

Closed
opened 2026-10-22 04:18:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2648
Author: @aeriondyseti
Created: 6/19/2026
Status: ✅ Merged
Merged: 6/20/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/issue-2647-game-voice-autoplay-loop


📝 Commits (5)

  • 25b959b Fix game-mode voice auto-play loop (#2647)
  • d072756 Fix game-mode voice overlap from spurious play() rejections (#2647)
  • bbb3e09 Merge branch 'staging' into fix/issue-2647-game-voice-autoplay-loop
  • 6f43300 Merge branch 'staging' into fix/issue-2647-game-voice-autoplay-loop
  • c098299 Merge branch 'staging' into fix/issue-2647-game-voice-autoplay-loop

📊 Changes

1 file changed (+61 additions, -4 deletions)

View changed files

📝 packages/client/src/components/game/GameNarration.tsx (+61 -4)

📄 Description

Why this change

Closes #2647.

In game (GM) mode with voice auto-play enabled, narrated voice lines could restart and duplicate themselves until manually stopped. The overlapping playback made game-mode TTS unusable for scenes with live voice generation.

What changed

  • Game voice playback now tracks every live <audio> element in a Set, so stopping playback tears down every active clip instead of only the most recent one.
  • Game voice auto-play now marks main and side voice keys as in flight synchronously, preventing gameVoiceVersion churn from relaunching the same ready clip before playback reports started.
  • play() rejection handling now treats a still-playing audio element as a normal start instead of dropping it from tracking, avoiding orphaned clips that cannot be stopped later.
  • No intentional behavior change outside game-mode voice auto-play.

Validation

  • pnpm check passed locally in a temporary checkout on June 20, 2026. The temp shell emitted a Node engine warning (v20.11.1 vs repo target >=24 <26), but the full check completed successfully.
  • GitHub pnpm-validate passed.
  • GitHub container-build-test passed.

Manual test plan (unchecked — for human verification)

  • In game mode with a TTS provider + voice auto-play, start a fresh scene that generates multiple voice lines; confirm a single voice plays per line with no echo/overlap.
  • Manually verify per-character / narrator voice routing still works in game mode.
  • Manually verify pause / resume / restart and the stop button.
  • Manually verify an autoplay-blocked clip (no user gesture yet) still retries after interaction (NotAllowedError -> onBlocked path).
  • Manually verify roleplay/VN and conversation TTS auto-play are unchanged.

🔄 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/2648 **Author:** [@aeriondyseti](https://github.com/aeriondyseti) **Created:** 6/19/2026 **Status:** ✅ Merged **Merged:** 6/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/issue-2647-game-voice-autoplay-loop` --- ### 📝 Commits (5) - [`25b959b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/25b959beb6ae1136c7c6962b45247c538886eccc) Fix game-mode voice auto-play loop (#2647) - [`d072756`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d0727569c05eb47fb4f65726df97ea5320000a68) Fix game-mode voice overlap from spurious play() rejections (#2647) - [`bbb3e09`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bbb3e09529d31c4b2819c8b2d43ca0e3201e5c14) Merge branch 'staging' into fix/issue-2647-game-voice-autoplay-loop - [`6f43300`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6f433007b0717d14993a00cb13cdada6fd5c37bf) Merge branch 'staging' into fix/issue-2647-game-voice-autoplay-loop - [`c098299`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c098299e172e74c2d78ad0a7e0a70311b5d269ab) Merge branch 'staging' into fix/issue-2647-game-voice-autoplay-loop ### 📊 Changes **1 file changed** (+61 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameNarration.tsx` (+61 -4) </details> ### 📄 Description ## Why this change Closes #2647. In **game (GM) mode** with voice auto-play enabled, narrated voice lines could restart and duplicate themselves until manually stopped. The overlapping playback made game-mode TTS unusable for scenes with live voice generation. ## What changed - Game voice playback now tracks every live `<audio>` element in a Set, so stopping playback tears down every active clip instead of only the most recent one. - Game voice auto-play now marks main and side voice keys as in flight synchronously, preventing `gameVoiceVersion` churn from relaunching the same ready clip before playback reports started. - `play()` rejection handling now treats a still-playing audio element as a normal start instead of dropping it from tracking, avoiding orphaned clips that cannot be stopped later. - No intentional behavior change outside game-mode voice auto-play. ## Validation - [x] `pnpm check` passed locally in a temporary checkout on June 20, 2026. The temp shell emitted a Node engine warning (`v20.11.1` vs repo target `>=24 <26`), but the full check completed successfully. - [x] GitHub `pnpm-validate` passed. - [x] GitHub `container-build-test` passed. ## Manual test plan (unchecked — for human verification) - [ ] In game mode with a TTS provider + voice auto-play, start a fresh scene that generates multiple voice lines; confirm a single voice plays per line with no echo/overlap. - [ ] Manually verify per-character / narrator voice routing still works in game mode. - [ ] Manually verify pause / resume / restart and the stop button. - [ ] Manually verify an autoplay-blocked clip (no user gesture yet) still retries after interaction (`NotAllowedError` -> `onBlocked` path). - [ ] Manually verify roleplay/VN and conversation TTS auto-play are unchanged. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:42 +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#5706
No description provided.