feat: add sentence-chunked text-to-speech playback#1496
Conversation
Reuse copyable message text, split it into engine-safe chunks, and expose deterministic pause, resume, skip, progress, and error state. Fixes #1480
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you: Chapters generated by Stage for commit 47dc95f on Jul 16, 2026 5:05pm UTC. |
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughChangesTTS read-aloud foundation
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related issues
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Preview APK for PR #1496Home-screen label: 1496 White Noise with the blueprint launcher icon — installs side-by-side with the production and staging apps. Install directly — one tap, no GitHub sign-in (public, content-addressed Every push to this PR rebuilds and updates this comment. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/main/java/dev/ipf/whitenoise/android/audio/tts/TtsController.kt`:
- Around line 74-87: Update TtsController.speak to inspect the status returned
by activeEngine.setLanguage(locale) before calling queue.start(chunks); for any
non-available result, report TtsState.Error and return false without starting
playback. Add coverage in TtsControllerTest for unsupported locales and verify
the queue is not started.
In `@app/src/main/java/dev/ipf/whitenoise/android/audio/tts/TtsPlaybackQueue.kt`:
- Around line 126-144: Update the error mapping in TtsPlaybackQueue.onError so
both TextToSpeech.ERROR_NETWORK and TextToSpeech.ERROR_NETWORK_TIMEOUT produce
TtsError.Network, while other codes remain TtsError.Synthesis. Extend
networkFailureIsDistinctFromOtherSynthesisFailures to cover the timeout code.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d4ee371c-65ac-41cc-ad3f-33097f6684af
📒 Files selected for processing (9)
app/src/main/java/dev/ipf/whitenoise/android/audio/tts/AndroidTtsSpeechEngine.ktapp/src/main/java/dev/ipf/whitenoise/android/audio/tts/TtsChunker.ktapp/src/main/java/dev/ipf/whitenoise/android/audio/tts/TtsController.ktapp/src/main/java/dev/ipf/whitenoise/android/audio/tts/TtsPlaybackQueue.ktapp/src/main/java/dev/ipf/whitenoise/android/core/MessageProjector.ktapp/src/test/java/dev/ipf/whitenoise/android/audio/tts/TtsChunkerTest.ktapp/src/test/java/dev/ipf/whitenoise/android/audio/tts/TtsControllerTest.ktapp/src/test/java/dev/ipf/whitenoise/android/audio/tts/TtsPlaybackQueueTest.ktapp/src/test/java/dev/ipf/whitenoise/android/core/MessageProjectorTest.kt
|
BLOCKING:
SUGGESTION:
NITPICK: SUMMARY: The copyable-text matrix, long-input splitting, queue generation handling, pause/resume, skip behavior, completion progress, and exact VERDICT: REQUEST_CHANGES |
Handle title abbreviations within sentence candidates, reject unsupported TTS locales before queueing, and classify network timeouts as network failures.
|
Addressed the blocking review and both suggestions in 47dc95f:
Added regressions for all three. Full local Android CI command set passes for both Zapstore and Play flavors. |
Summary
Test plan
The engine resolver/audio-focus implementation remains in #1479. The conversation action and transport UI consume this controller in #1481.
Fixes #1480
Summary by CodeRabbit
New Features
Bug Fixes
Tests