Repository navigation
Conversation
Reads the post title, self text, and expanded comments aloud using the system text-to-speech engine, scrolling to each comment as it is read. Starts from the first visible item, so the user can pick where to begin. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a "Read aloud" button to the floating toolbar in the comment listing. It reads the post title, self text, and every expanded comment using the system text-to-speech engine, starting from the first visible item, and scrolls to each comment as it is read. Tapping the button again stops it, and leaving the screen stops it too.
This is a first, deliberately small step towards #1360. Things like a media notification, lockscreen controls, pause/resume, and skipping between comments are not included, and I'm happy to follow up with those separately if there's interest.
Details
NativeTTSManageris a small singleton wrapper aroundTextToSpeech. Text over the engine's maximum input length is split (without splitting surrogate pairs), and callbacks from a previous run are ignored after a stop or restart.speak()failures show an error toast instead of failing silently.TTS_SERVICEquery. Without it, Android 11+ hides third-party engines from the app, and it quietly falls back to the Google engine instead of the user's chosen one.Testing
NativeTTSManagerTest(18 tests, Robolectric with a fake engine) covering ordering, chunking, stale callbacks, error handling, and listener handling.pmd checkstyle lint testall pass.One thing you may notice: there is a short gap between items, because each item is only sent to the engine once the previous one finishes.
🤖 Generated with Claude Code