Skip to content

Feat/td 1747 fallback voice - #1671

Open
rlaerm wants to merge 5 commits into
mainfrom
feat/TD-1747-fallback-voice
Open

rlaerm wants to merge 5 commits into
mainfrom
feat/TD-1747-fallback-voice

Conversation

@rlaerm

@rlaerm rlaerm commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI balanced review requested due to automatic review settings November 11, 2026 14:36
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Seeking twice before the Blob source’s metadata loads applies the first target instead of the latest one because the pending seek callback is not updated.

1 open issue
What changed in this PR

This PR centralizes fallback voice selection and extends read-aloud support for long messages across speech generation and browser playback.

Changes:

  • Reuses voice fallback logic for streaming and cached previews.
  • Splits long text into sequential speech requests with per-segment timeouts and combined usage.
  • Adds windowed audio buffering, full-audio seeking, sliced waveform decoding, and supporting documentation.
File Description
packages/​shared/​src/​speech/​utils.ts Adds shared voice selection helpers.
packages/​shared/​src/​speech/​streaming/​start-streaming.ts Reuses voice fallback for streaming.
packages/​shared/​src/​speech/​speech-service.ts Applies fallback consistently to previews and cache keys.
packages/​shared/​src/​speech/​speech-service.test.ts Updates unknown-voice coverage for fallback behavior.
packages/​ai-core/​src/​speech/​text/​split.ts Splits text at paragraph, sentence, and word boundaries.
packages/​ai-core/​src/​speech/​text/​split.test.ts Tests splitting limits and content preservation.
packages/​ai-core/​src/​speech/​text/​preprocess.ts Adds a pass-through preprocessing hook.
packages/​ai-core/​src/​speech/​stream-segments.ts Streams segments sequentially and combines usage.
packages/​ai-core/​src/​speech/​stream-segments.test.ts Tests ordering, failures, timeouts, and early termination.
packages/​ai-core/​src/​speech/​generate-stream.ts Integrates splitting and per-segment timeouts.
docs/​concepts/​text-to-speech.md Documents speech generation and playback behavior.
docs/​concepts/​README.md Links the text-to-speech guide.
apps/​chat-bot/​src/​utils/​audio/​mp3-waveform.ts Computes waveform peaks through sliced decoding.
apps/​chat-bot/​src/​utils/​audio/​mp3-stream-player.ts Adds windowed buffering and Blob-backed seeking.
apps/​chat-bot/​src/​utils/​audio/​mp3-frames.ts Parses MP3 frames and calculates duration.
apps/​chat-bot/​src/​components/​chat/​speech/​use-audio-stream.ts Logs playback failures before cleanup.

Review effort: Balanced

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Playwright Smart Reporter

Passed: 39 of 39 tests passed.

Pass rate Passed Failed Flaky Skipped Duration
100% 39 0 0 0 1.5m

Baseline run: main @ f5778ad4

Slowest tests

Test Duration
character is submitted, rejected, resubmitted and approved across chat-bot and admin [chromium] 28.5s
teacher can login, create and join shared dialogpartner chat [chromium] 22.2s
can be set in the overview and the detail page and removed again [chromium] 20.2s
teacher can login, create an assistant and start a chat [chromium] 15.5s
should successfully upload a file and get response about its contents [chromium] 13.7s

Open the full report

…-voice

# Conflicts:
#	apps/chat-bot/src/utils/audio/mp3-stream-player.ts

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants