[PR #7855] [MERGED] fix(avatars): animate with the voice when replies are spoken #7971

Closed
opened 2026-10-24 04:09:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/avatars-stream-audio-sync


📝 Commits (4)

  • 52c6eaf fix(avatars): animate with the voice when replies are spoken
  • 431eb27 Merge remote-tracking branch 'origin/staging' into fix/avatars-stream-audio-sync
  • e15e599 fix(avatars): match the end of a reading by its own id
  • 7c39a71 fix(avatars): do not count an earlier reading's voice as the new one

📊 Changes

12 files changed (+1116 additions, -88 deletions)

View changed files

📝 docs/agents/avatars.md (+12 -1)
➕ e2e/avatar-voice-sync.e2e.ts (+454 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+86 -70)
📝 packages/client/src/features/avatars/audio/avatar-audio.ts (+10 -2)
📝 packages/client/src/features/avatars/contract.ts (+7 -1)
📝 packages/client/src/features/avatars/director/avatar-director.ts (+219 -9)
📝 packages/client/src/features/avatars/stage/AvatarStage.tsx (+7 -0)
📝 packages/client/src/lib/tts-autoplay.ts (+15 -0)
📝 packages/client/src/lib/tts-service.ts (+10 -1)
📝 scripts/regressions/avatar-director.regression.ts (+246 -2)
📝 scripts/regressions/avatar-tts-lipsync.regression.ts (+10 -1)
📝 scripts/regressions/fixtures/avatar-3d-fixtures.ts (+40 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

None. This comes from @SpicyMarinara's request on 2026-10-19: make 2D and 3D avatars work with streaming and with audio, where the audio usually arrives after the reply finished streaming. No issue was opened; open one first if you want this tracked.

Why this change

With text-to-speech Auto-play on in Roleplay, the avatar talked twice and showed its moods at the wrong time. I measured this in the real app: a fake model streamed a reply for about 3.8 s, with paragraphs that read happy, sad and angry, and a fake voice answered a few seconds later.

Before (staging be73c3122, voice starting about 7 s after the reply):

  • The mouth moved with the text while it streamed (0.3–6.1 s), then stopped.
  • The faces played out during the stream (happy, sad, angry) and relaxed to calm at about 9.7 s.
  • The voice played from 11.0 to 21.0 s on a calm face. All three moods were lost, and the mouth talked a second time.
  • With a shorter delay, the face stayed angry (the last streamed paragraph) while the voice read the happy part.
  • An Expression Engine pick replaced the face in the middle of the voice.
  • Pauses between clips, and the end of the voice, snapped the face to calm with no fade.
  • The same happened with the real VRoid model (Maukie.vrm).

After (this branch, recorded by the new e2e test, times in seconds after Send):

  • Voice off (2D): talks with the text 0.2–6.0. Faces: happy 0.1, sad 2.7, angry 4.7, calm 9.8. This is unchanged.
  • Voice 3 s late (2D): nothing moves while the reply streams (0–3.6). Voice 7.25–16.0. Mouth moves 7.3–16.0. Faces: happy 7.3, sad 10.3, angry 13.5, each when the voice reaches that paragraph. Calm at 20.9, about 5 s after the voice.
  • Voice 3 s late (3D): voice 6.7–15.4. VRM faces: happy 6.8, sad 9.8, angry 12.9. The VRM's mouth shapes move only during the voice. Calm at 20.4.
  • Voice fails (2D and 3D): the provider returns an error at about 4.8. The text animation plays once from about 6.0: talking 6.0–13.8, then happy, sad and angry. Calm at about 17.8.

What changed

  • lib/tts-autoplay.ts, ChatArea.tsx: auto-play announces a reading (marinara:tts-autoplay-voice, {chatId, messageId, readingId, pending}):
    • readingId is new for every reading, so the end of a replaced reading (a regenerated swipe keeps its message id) never ends the wait for the new one.
    • pending: true is sent before the speaker extractor or the voice loads.
    • The director counts a voice for this reading only after the reading is announced. A voice from an earlier reading that is already playing at that moment does not count, until the new reading stops it.
    • pending: false is sent in a finally however the reading ends: played, failed, no lines to read, stopped, superseded or chat changed.
    • The rest of speakTTSAutoplayMessage only moved inside the try (use "Hide whitespace" in the diff).
  • AvatarStage.tsx: tells the director whether Roleplay auto-play is on. It uses the same check ChatArea makes (enabled && autoplayRP, shared useTTSConfig cache).
  • avatar-director.ts: when a reply will be read aloud, the director waits for the voice:
    • The text moves no mouth. Classifier results and Expression Engine picks are held, and the face does not relax.
    • The voice moves the mouth, as before (#7547).
    • Each sentence of the clip's text gets its mood when the voice reaches its share of the clip. The normal 0.45, 0.15, 2 s and two-calm rules still apply. Uncached sentences go to the classifier a few ahead of the voice.
    • Progressive or per-line clips line up clip by clip.
    • The face relaxes about 4 s after the voice, counted from the last moment any voice played, so pauses between clips no longer snap it to calm.
    • The Expression Engine pick shows when the reading is over.
  • Readings that never play:
    • If it ends within 5 s of the reply (error, no lines, nothing started within 2 s), the text animation replays once over at most 8 s: mouth and moods as if streaming. The pick shows after the replay.
    • If it ends later, there is no late talking. The reply's last mood shows, then relaxes as usual.
    • After 30 s with no voice (still loading, paused, or Safari waiting for a tap), the avatar stops waiting. A voice that comes later still moves the mouth.
  • tts-service.ts, avatar-audio.ts, contract.ts:
    • TTSPlayback carries the clip's text.
    • The level source gains line(): the text, and how far the voice is through the decoded clip (0..1).
    • The director contract gains setVoiceAutoplay.
  • Speak button: the voice now shows moods sentence by sentence too, unless the Expression Engine already settled that reply's face. The face relaxes about 4 s after the voice.
  • Tests:
    • New "Text-to-speech auto-play" section in avatar-director.regression.ts. I checked that it fails against the old director, both for the double talking and for the snap in a pause between clips.
    • The director section also covers a regenerated swipe: the replaced reading ends while the new one still loads, and the avatar keeps waiting.
    • It also covers an earlier reading that is still playing while the next reply streams. That voice does not count as the new reading, so when the new reading fails, the text animation still plays.
    • line() checks in avatar-tts-lipsync.regression.ts.
    • New e2e/avatar-voice-sync.e2e.ts: a real Roleplay chat with a fake streaming model and a fake delayed or failing voice, for a 2D and a 3D avatar. It records the stage's director frames and what the renderer drew (PNGTuber picture colours, VRM expression weights).
    • The 3D model is built in code from the existing 9 KB fixture (expressiveVrm()). No new binary is committed.
  • Docs: docs/agents/avatars.md gains "When the reply is read aloud", plus one line each in the Expression Engine and lip sync sections. No existing wording changed.

Decisions made while you were asleep

These are the conservative choices; each is easy to change.

  • Timings:
    • voiceStartGraceMs 2 s: how long to wait for a reading to begin after the reply ends.
    • voiceReplayWithinMs 5 s: a failure within this time replays the text animation; later ones only show the last mood.
    • voiceWaitMaxMs 30 s: the longest the avatar waits without hearing a voice.
    • All three are in AVATAR_DIRECTOR_TIMING.
  • 30 s cap with the Expression Engine: after the cap, the held Expression Engine pick also shows. A very slow voice (local TTS over 30 s) then plays with the mouth moving but the pick's face, as on staging today.
  • Waiting state: the avatar is idle while it waits (it still blinks and moves; "thinking" stays limited to before the first word, as today).
  • Narrator voice: when the narrator's voice reads everything, no character's mouth moves, as before. After the reading, each character shows the reply's last mood.
  • Not changed:
    • Game mode: it plays its own audio, and avatars still follow the text there. The docs already say "for now".
    • Streaming off: a mixed-mood reply is still classified as one text and may show no face. This is unchanged and only affects the fallback replay.
    • Clip start: the mouth still stays shut for about 0.1–0.4 s at each clip start while the clip is decoded.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Run by the agent (results, not ticks):

  • pnpm check: passed on the branch after merging current staging (0ebf2efaa). Its one lint warning is from staging, in HomeProfessorMariChat.tsx.
  • Regressions: all 30 avatar-*, tts-*, game-tts-*, roleplay-vn-tts and npc-avatar-lan regressions passed. So did the four that read ChatArea.tsx (open-issues, roleplay-streaming, character-identity, frozen-server-client-timeouts).
  • The new director section fails against the old director, both for the double talking and for the snap in a pause between clips. The new section did not change or weaken any existing assertion.
  • e2e (desktop-chromium, one worker, --mute-audio and --disable-audio-output): 47 passed. That covers the new avatar-voice-sync (2D and 3D, with the voice off, late and failing) plus avatar-2d, avatar-vrm, avatar-placement, avatar-preview, avatar-setup, avatar-vrm-tripo-removed, avatar-generation, tts-pcm-settings, tts-request-timeout, scene-tts-preferences and tts-mobile-playback. Mobile and WebKit projects were not run.
  • Real app, real model. I replayed the investigation harness against this branch with /Users/marysia/Desktop/Maukie-VRoid/Maukie.vrm, which is not committed:
    • With the voice 7 s late, nothing moved during the stream. The voice played 15.1–25.1 s. The VRM faces changed happy 15.5, sad 18.6, angry 22.3, and its mouth shapes moved only during the voice. It was calm at 30.0.
    • With the Expression Engine (2D), the pick arrived mid-voice at 8.7 s and was held. The voice moods kept playing, and the pick's face showed at the voice's end (16.1 s) and stayed.
  • After the CodeRabbit rounds (e15e599f7 per-reading id, 7c39a7134 earlier voice): all 19 avatar-* and 7 tts-* regressions passed, and the changed files pass tsc, ESLint and Prettier. Both new director cases fail against the director from before each fix. On 7c39a7134, avatar-voice-sync and avatar-2d e2e passed again (20 tests, desktop-chromium, one worker, muted). The other e2e files above were not run again.
  • Not run: the local CodeRabbit CLI (this task's policy is GitHub CodeRabbit only), Docker or Podman, and a manual click-through.

Manual verification notes

To verify in the morning (Roleplay chat, 2D Avatars and 3D Avatars):

  • Voice off: turn Text to Speech off (or Auto-play off) and send a message. Verify in the browser that the avatar talks and changes faces while the reply streams, then relaxes about 4 s after it ends, as before.
  • Auto-play on: send a message. Verify the avatar's mouth stays still and its face does not change while the reply streams, and that it blinks and moves.
  • When the voice starts: verify the mouth moves with the voice, and the face changes as the voice reaches each mood (try a reply that goes happy, then sad, then angry).
  • After the voice: verify the face holds until the voice ends and relaxes about 4 s later.
  • Expression Engine on: verify its face appears only after the voice finishes, not in the middle.
  • Stop and pause: press Stop on the voice mid-reply and verify the mouth stops and the face relaxes about 4 s later. Pause it and verify the same.
  • Broken voice: use a wrong voice or API key so TTS fails. Verify the avatar then plays the text animation once (mouth and moods) and relaxes, and never sits waiting.
  • Progressive playback and Only read dialogues: with pauses between lines, verify the face does not snap to calm between lines and the moods follow each line.
  • Speak button: on an older message, verify the moods follow its voice too.
  • 3D: repeat the auto-play checks with the real Maukie.vrm.
  • Safari or iPhone (blocked autoplay): verify the avatar stops waiting after about 30 s if you never tap, and that tapping plays the voice with the mouth moving.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

docs/agents/avatars.md is updated in English. As instructed for this task, no [docs-i18n] issue was opened, so the translated packs still need the same update. There are no UI strings, so no en.json changes, and no version or changelog changes.

UI evidence (if applicable)

There is no new UI. The e2e test saves a screenshot and the full timeline (timeline.json) for each run in its output folder.

Summary by CodeRabbit

  • New Features
    • In Roleplay chats with voice auto-play enabled, avatars now wait for speech before changing expressions or moving their mouths, then sync facial expressions and mouth movement to spoken sentences.
    • If speech fails or does not begin, avatars can fall back to text-based animation, with waiting ending after 30 seconds.
    • Voice-driven facial expressions also apply when using Speak, unless the Expression Engine has already selected an expression.
  • Documentation
    • Updated the avatar guide with voice-sync behavior and fallback details.

🔄 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/7855 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/avatars-stream-audio-sync` --- ### 📝 Commits (4) - [`52c6eaf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/52c6eaf6206855e3037c43fa26b5f95ee6a03245) fix(avatars): animate with the voice when replies are spoken - [`431eb27`](https://github.com/Pasta-Devs/Marinara-Engine/commit/431eb27e1e615e7843b3cfb2cf3ed16ea4e9fff7) Merge remote-tracking branch 'origin/staging' into fix/avatars-stream-audio-sync - [`e15e599`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e15e599f7b8a234a0af784f7c2449804f79e642b) fix(avatars): match the end of a reading by its own id - [`7c39a71`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7c39a71346f5c2b1254089a87d5f9d9fb827730e) fix(avatars): do not count an earlier reading's voice as the new one ### 📊 Changes **12 files changed** (+1116 additions, -88 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+12 -1) ➕ `e2e/avatar-voice-sync.e2e.ts` (+454 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+86 -70) 📝 `packages/client/src/features/avatars/audio/avatar-audio.ts` (+10 -2) 📝 `packages/client/src/features/avatars/contract.ts` (+7 -1) 📝 `packages/client/src/features/avatars/director/avatar-director.ts` (+219 -9) 📝 `packages/client/src/features/avatars/stage/AvatarStage.tsx` (+7 -0) 📝 `packages/client/src/lib/tts-autoplay.ts` (+15 -0) 📝 `packages/client/src/lib/tts-service.ts` (+10 -1) 📝 `scripts/regressions/avatar-director.regression.ts` (+246 -2) 📝 `scripts/regressions/avatar-tts-lipsync.regression.ts` (+10 -1) 📝 `scripts/regressions/fixtures/avatar-3d-fixtures.ts` (+40 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue None. This comes from @SpicyMarinara's request on 2026-10-19: make 2D and 3D avatars work with streaming and with audio, where the audio usually arrives after the reply finished streaming. No issue was opened; open one first if you want this tracked. ## Why this change With text-to-speech **Auto-play** on in Roleplay, the avatar talked twice and showed its moods at the wrong time. I measured this in the real app: a fake model streamed a reply for about 3.8 s, with paragraphs that read happy, sad and angry, and a fake voice answered a few seconds later. **Before** (staging `be73c3122`, voice starting about 7 s after the reply): - The mouth moved with the text while it streamed (0.3–6.1 s), then stopped. - The faces played out during the stream (happy, sad, angry) and relaxed to calm at about 9.7 s. - The voice played from 11.0 to 21.0 s on a calm face. All three moods were lost, and the mouth talked a second time. - With a shorter delay, the face stayed angry (the last streamed paragraph) while the voice read the happy part. - An Expression Engine pick replaced the face in the middle of the voice. - Pauses between clips, and the end of the voice, snapped the face to calm with no fade. - The same happened with the real VRoid model (Maukie.vrm). **After** (this branch, recorded by the new e2e test, times in seconds after Send): - **Voice off (2D):** talks with the text 0.2–6.0. Faces: happy 0.1, sad 2.7, angry 4.7, calm 9.8. This is unchanged. - **Voice 3 s late (2D):** nothing moves while the reply streams (0–3.6). Voice 7.25–16.0. Mouth moves 7.3–16.0. Faces: happy 7.3, sad 10.3, angry 13.5, each when the voice reaches that paragraph. Calm at 20.9, about 5 s after the voice. - **Voice 3 s late (3D):** voice 6.7–15.4. VRM faces: happy 6.8, sad 9.8, angry 12.9. The VRM's mouth shapes move only during the voice. Calm at 20.4. - **Voice fails (2D and 3D):** the provider returns an error at about 4.8. The text animation plays once from about 6.0: talking 6.0–13.8, then happy, sad and angry. Calm at about 17.8. ## What changed - **`lib/tts-autoplay.ts`, `ChatArea.tsx`:** auto-play announces a reading (`marinara:tts-autoplay-voice`, `{chatId, messageId, readingId, pending}`): - `readingId` is new for every reading, so the end of a replaced reading (a regenerated swipe keeps its message id) never ends the wait for the new one. - `pending: true` is sent before the speaker extractor or the voice loads. - The director counts a voice for this reading only after the reading is announced. A voice from an earlier reading that is already playing at that moment does not count, until the new reading stops it. - `pending: false` is sent in a `finally` however the reading ends: played, failed, no lines to read, stopped, superseded or chat changed. - The rest of `speakTTSAutoplayMessage` only moved inside the `try` (use "Hide whitespace" in the diff). - **`AvatarStage.tsx`:** tells the director whether Roleplay auto-play is on. It uses the same check ChatArea makes (`enabled && autoplayRP`, shared `useTTSConfig` cache). - **`avatar-director.ts`:** when a reply will be read aloud, the director waits for the voice: - The text moves no mouth. Classifier results and Expression Engine picks are held, and the face does not relax. - The voice moves the mouth, as before (#7547). - Each sentence of the clip's text gets its mood when the voice reaches its share of the clip. The normal 0.45, 0.15, 2 s and two-calm rules still apply. Uncached sentences go to the classifier a few ahead of the voice. - Progressive or per-line clips line up clip by clip. - The face relaxes about 4 s after the voice, counted from the last moment any voice played, so pauses between clips no longer snap it to calm. - The Expression Engine pick shows when the reading is over. - **Readings that never play:** - If it ends within 5 s of the reply (error, no lines, nothing started within 2 s), the text animation replays once over at most 8 s: mouth and moods as if streaming. The pick shows after the replay. - If it ends later, there is no late talking. The reply's last mood shows, then relaxes as usual. - After 30 s with no voice (still loading, paused, or Safari waiting for a tap), the avatar stops waiting. A voice that comes later still moves the mouth. - **`tts-service.ts`, `avatar-audio.ts`, `contract.ts`:** - `TTSPlayback` carries the clip's text. - The level source gains `line()`: the text, and how far the voice is through the decoded clip (0..1). - The director contract gains `setVoiceAutoplay`. - **Speak button:** the voice now shows moods sentence by sentence too, unless the Expression Engine already settled that reply's face. The face relaxes about 4 s after the voice. - **Tests:** - New "Text-to-speech auto-play" section in `avatar-director.regression.ts`. I checked that it fails against the old director, both for the double talking and for the snap in a pause between clips. - The director section also covers a regenerated swipe: the replaced reading ends while the new one still loads, and the avatar keeps waiting. - It also covers an earlier reading that is still playing while the next reply streams. That voice does not count as the new reading, so when the new reading fails, the text animation still plays. - `line()` checks in `avatar-tts-lipsync.regression.ts`. - New `e2e/avatar-voice-sync.e2e.ts`: a real Roleplay chat with a fake streaming model and a fake delayed or failing voice, for a 2D and a 3D avatar. It records the stage's director frames and what the renderer drew (PNGTuber picture colours, VRM expression weights). - The 3D model is built in code from the existing 9 KB fixture (`expressiveVrm()`). No new binary is committed. - **Docs:** `docs/agents/avatars.md` gains "When the reply is read aloud", plus one line each in the Expression Engine and lip sync sections. No existing wording changed. ## Decisions made while you were asleep These are the conservative choices; each is easy to change. - **Timings:** - `voiceStartGraceMs` 2 s: how long to wait for a reading to begin after the reply ends. - `voiceReplayWithinMs` 5 s: a failure within this time replays the text animation; later ones only show the last mood. - `voiceWaitMaxMs` 30 s: the longest the avatar waits without hearing a voice. - All three are in `AVATAR_DIRECTOR_TIMING`. - **30 s cap with the Expression Engine:** after the cap, the held Expression Engine pick also shows. A very slow voice (local TTS over 30 s) then plays with the mouth moving but the pick's face, as on staging today. - **Waiting state:** the avatar is idle while it waits (it still blinks and moves; "thinking" stays limited to before the first word, as today). - **Narrator voice:** when the narrator's voice reads everything, no character's mouth moves, as before. After the reading, each character shows the reply's last mood. - **Not changed:** - **Game mode:** it plays its own audio, and avatars still follow the text there. The docs already say "for now". - **Streaming off:** a mixed-mood reply is still classified as one text and may show no face. This is unchanged and only affects the fallback replay. - **Clip start:** the mouth still stays shut for about 0.1–0.4 s at each clip start while the clip is decoded. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Run by the agent (results, not ticks): - `pnpm check`: passed on the branch after merging current `staging` (`0ebf2efaa`). Its one lint warning is from staging, in `HomeProfessorMariChat.tsx`. - Regressions: all 30 `avatar-*`, `tts-*`, `game-tts-*`, `roleplay-vn-tts` and `npc-avatar-lan` regressions passed. So did the four that read `ChatArea.tsx` (`open-issues`, `roleplay-streaming`, `character-identity`, `frozen-server-client-timeouts`). - The new director section fails against the old director, both for the double talking and for the snap in a pause between clips. The new section did not change or weaken any existing assertion. - e2e (`desktop-chromium`, one worker, `--mute-audio` and `--disable-audio-output`): 47 passed. That covers the new `avatar-voice-sync` (2D and 3D, with the voice off, late and failing) plus `avatar-2d`, `avatar-vrm`, `avatar-placement`, `avatar-preview`, `avatar-setup`, `avatar-vrm-tripo-removed`, `avatar-generation`, `tts-pcm-settings`, `tts-request-timeout`, `scene-tts-preferences` and `tts-mobile-playback`. Mobile and WebKit projects were not run. - **Real app, real model.** I replayed the investigation harness against this branch with `/Users/marysia/Desktop/Maukie-VRoid/Maukie.vrm`, which is not committed: - With the voice 7 s late, nothing moved during the stream. The voice played 15.1–25.1 s. The VRM faces changed happy 15.5, sad 18.6, angry 22.3, and its mouth shapes moved only during the voice. It was calm at 30.0. - With the Expression Engine (2D), the pick arrived mid-voice at 8.7 s and was held. The voice moods kept playing, and the pick's face showed at the voice's end (16.1 s) and stayed. - After the CodeRabbit rounds (`e15e599f7` per-reading id, `7c39a7134` earlier voice): all 19 `avatar-*` and 7 `tts-*` regressions passed, and the changed files pass `tsc`, ESLint and Prettier. Both new director cases fail against the director from before each fix. On `7c39a7134`, `avatar-voice-sync` and `avatar-2d` e2e passed again (20 tests, `desktop-chromium`, one worker, muted). The other e2e files above were not run again. - Not run: the local CodeRabbit CLI (this task's policy is GitHub CodeRabbit only), Docker or Podman, and a manual click-through. ### Manual verification notes To verify in the morning (Roleplay chat, 2D Avatars and 3D Avatars): - [ ] **Voice off:** turn Text to Speech off (or Auto-play off) and send a message. Verify in the browser that the avatar talks and changes faces while the reply streams, then relaxes about 4 s after it ends, as before. - [ ] **Auto-play on:** send a message. Verify the avatar's mouth stays still and its face does not change while the reply streams, and that it blinks and moves. - [ ] **When the voice starts:** verify the mouth moves with the voice, and the face changes as the voice reaches each mood (try a reply that goes happy, then sad, then angry). - [ ] **After the voice:** verify the face holds until the voice ends and relaxes about 4 s later. - [ ] **Expression Engine on:** verify its face appears only after the voice finishes, not in the middle. - [ ] **Stop and pause:** press Stop on the voice mid-reply and verify the mouth stops and the face relaxes about 4 s later. Pause it and verify the same. - [ ] **Broken voice:** use a wrong voice or API key so TTS fails. Verify the avatar then plays the text animation once (mouth and moods) and relaxes, and never sits waiting. - [ ] **Progressive playback and Only read dialogues:** with pauses between lines, verify the face does not snap to calm between lines and the moods follow each line. - [ ] **Speak button:** on an older message, verify the moods follow its voice too. - [ ] **3D:** repeat the auto-play checks with the real Maukie.vrm. - [ ] **Safari or iPhone (blocked autoplay):** verify the avatar stops waiting after about 30 s if you never tap, and that tapping plays the voice with the mouth moving. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) `docs/agents/avatars.md` is updated in English. As instructed for this task, no `[docs-i18n]` issue was opened, so the translated packs still need the same update. There are no UI strings, so no `en.json` changes, and no version or changelog changes. ## UI evidence (if applicable) There is no new UI. The e2e test saves a screenshot and the full timeline (`timeline.json`) for each run in its output folder. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * In Roleplay chats with voice auto-play enabled, avatars now wait for speech before changing expressions or moving their mouths, then sync facial expressions and mouth movement to spoken sentences. * If speech fails or does not begin, avatars can fall back to text-based animation, with waiting ending after 30 seconds. * Voice-driven facial expressions also apply when using **Speak**, unless the Expression Engine has already selected an expression. * **Documentation** * Updated the avatar guide with voice-sync behavior and fallback details. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:09:17 +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#7971
No description provided.