mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8650] [MERGED] fix(tts): a speaker the extractor names by first name uses that card's voice #8723
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8723
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8650
Author: @SpicyMarinara
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/speaker-extractor-card-voices-8638📝 Commits (5)
7ec424afix(tts): a speaker the extractor names by first name uses that card's voice (#8638)e4f2394fix(tts): a two-letter first name is a short form of a card's name (#8638)43771f2fix(tts): a name that fits two chat cards never takes an outside card's voice; different titles are two people (#8638)8476a92fix(tts): an initial in a short name must fit the card's name (#8638)448fa44fix(tts): Game narration also keeps a roster-ambiguous speaker off an outside card's voice (#8638)📊 Changes
8 files changed (+349 additions, -12 deletions)
View changed files
📝
packages/client/src/components/chat/ChatArea.tsx(+5 -0)📝
packages/client/src/components/chat/ChatMessage.tsx(+7 -0)📝
packages/client/src/components/game/GameNarration.tsx(+19 -3)📝
packages/client/src/lib/tts-dialogue.ts(+53 -8)📝
packages/client/src/lib/tts-roleplay-speaker-extractor.ts(+2 -0)📝
packages/shared/src/utils/game-character-name-match.ts(+43 -0)📝
scripts/regressions/game-tts-emotion.regression.ts(+25 -1)📝
scripts/regressions/tts-source-persistence.regression.ts(+195 -0)📄 Description
Linked issue
Closes #8638
Why this change
What changed
isShortFormOfCharacterName(shared,game-character-name-match.ts): every word of the speaker's name must appear in the card's name.characterNamesMatch) keeps its own tokenizer, unchanged.Chat lookup (
findTTSCharacterIdBySpeakerName): after the exact and base-name steps, a short name links to the one chat card or persona it fits, so a chat card keeps its own voice settings. The newisTTSSpeakerAmbiguousreports when a name fits more than one chat card.resolveTTSVoiceForSpeaker: when no chat card claims the speaker, it falls back to the one voiced card whose name contains the speaker's name. Cards that would give different voices give none. It skips this fallback when the name fits several chat cards: "Junpei" with "Junpei Iori" and "Junpei Kato" in the chat never takes an outside "Junpei Sato" card's voice. Exact and base-name matches still win, and narrator names still follow the narrator setting. A card's configured voice still comes before the random NPC voice pool.Request builders (
buildTTSVoiceRequests,buildExtractedRoleplayTTSVoiceRequests) take an optional ambiguity check.ChatAreaandChatMessagepass one built from the same chat roster they already use for the card lookup.Regressions in
scripts/regressions/tts-source-persistence.regression.tscover:Each new case fails without its fix.
Behaviour to know about. The fallback runs wherever a speaker has no card ID, including Game narration and combat lines. A Game NPC called by part of a voiced card's name now uses that card's voice instead of the random NPC pool. A single title word that a voiced card's name contains, such as "Professor" for a card named "Professor Mari", also takes that card's voice.
Left as is (from review). An outside card whose name is exactly the speaker's name, such as a card named "Junpei", still voices "Junpei" even when two chat cards also fit. That exact-name lookup was already there before this PR, and an exact name is the strongest match there is. Changing it would change behaviour beyond #8638.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What the agent ran locally:
node ./scripts/pnpm-runner.mjs checkpasses.tts-source-persistence,avatar-director,avatar-tts-lipsync,game-tts-emotion,roleplay-vn-tts,tts-sequence-cache-identity,generate-reply-text-cleanup,multiplayer-game-persona,multiplayer-room-fightandopen-issues.To verify by hand:
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No docs change: this fixes matching behind an existing setting.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.