mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#8719
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/8641
Author: @SpicyMarinara
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/game-tts-emotion-8619📝 Commits (1)
d4b473ffix(tts): Game mode no longer speaks the sprite emotion before each line📊 Changes
8 files changed (+223 additions, -99 deletions)
View changed files
📝
packages/client/src/components/game/GameCombatUI.tsx(+2 -1)📝
packages/client/src/components/game/GameNarration.tsx(+2 -76)➕
packages/client/src/lib/game-tts-emotion.ts(+62 -0)📝
packages/server/src/routes/tts.routes.ts(+19 -5)📝
packages/shared/src/types/tts.ts(+54 -0)📝
scripts/regressions/game-tts-emotion.regression.ts(+22 -5)📝
scripts/regressions/prompt.regression.ts(+60 -10)📝
scripts/regressions/tts-source-persistence.regression.ts(+2 -2)📄 Description
Closes #8619
Why this change
With ElevenLabs, Game mode reads the line's emotion aloud before the dialogue — the reporter hears "neutral. Four thirty-one…" — while Roleplay does not, and no combination of TTS toggles helps. Their attached report (ElevenLabs,
eleven_v4) traced it accurately:tone, falling back toneutralfor a plain line (GameNarration'sresolveGameSegmentTtsEmotion).[smirk] Four thirty-one…(buildElevenLabsTextInput).neutral,smirk,thinking,sleepy,blushing, … — are not documented tags.It is worse on the default model:
eleven_multilingual_v2(and flash/turbo) have no audio tags at all, so they read every bracket aloud. The prefix is added server-side after the client's speech filters run, which is why no setting could remove it. Roleplay was unaffected because it does not send a sprite expression as the tone.What changed
types/tts.ts): the game's 16 expressions (GAME_TTS_EMOTIONS) and the documented ElevenLabs tag each one is spoken with, ornullwhen none means it:happy,sad,angry,surprisedas themselves;thinking → thoughtful,disgusted → appalled,laughing → laughs,crying → crying,smirk → mischievously;neutral,scared,blushing,embarrassed,determined,confused,sleepy→ no tag. Tags are taken from ElevenLabs' v3/v4 prompting guide. The map is a completeRecord, so a new expression cannot be added without deciding its tag.buildElevenLabsTextInput(text, tone, model)adds nothing unless the model reads audio tags (eleven_v3,eleven_v4, NanoGPT'sElevenlabs-V3). A game expression becomes its documented tag or none. Any other tone is a cue written to be performed — the Roleplay speaker extractor's opt-in emotion indicators — and is kept as written.line.expression(e.g.grin) with no normalisation, so it had the same problem. The expression normaliser moves fromGameNarrationtolib/game-tts-emotion.ts, and combat now folds its expression into the same vocabulary (grin → happy; an expression that names none sends no tone).OpenAI-compatible sources are unchanged: they receive the tone as spoken instructions (
Use a … tone.), never as text.Validation
prompt.regression.ts: the case that pinned[neutral],[thinking]and[smirk](the bug itself) is rewritten to the new contract — undocumented expressions send no tag, mapped ones send their documented tag, every map value is a documented tag, free-form cues pass through, non-tag models get no bracket, NanoGPT's Eleven v3 does. On the route before this change it fails:'[neutral] Reserved. Tomorrow afternoon.'.game-tts-emotion.regression.tsnow uses the real moved module, and proves combat foldsgrin → happy,Smirking → smirk, and sends no tone for an expression that names none. On the combat code before this change it fails: tone'grin'.scripts/regressions/tsconfig*.jsonlane typechecks; client and servertsc --noEmitpass;linthas 0 errors; Prettier clean.One deliberate limit:
eleven_v4_turbois left out of the audio-tag models. ElevenLabs' guide documents tags for Eleven v3 and v4 only; if turbo performs them too, adding it toELEVENLABS_AUDIO_TAG_MODELSis a one-word change.Test plan
eleven_v4, Game narration autoplay on: play several Game lines with different expressions; confirm no emotion word is spoken before any line.eleven_multilingual_v2; confirm no bracketed word is spoken and lines are read plainly.eleven_v4, confirm a happy, sad or angry line still sounds delivered with that emotion.eleven_v3/eleven_v4: confirm the extractor's cues still shape delivery as before.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.