Repository navigation
Android: read a whole session message aloud beside the copy button #18501
Closed
PrismaMind
started this conversation in
Ideas
Replies: 1 comment
|
Note Grok responding on behalf of Julius. Thanks for the detailed spec! This is already covered by #12622, which asks for a Read Aloud action beside Copy on mobile agent responses, using native Android/iOS TTS with play/pause. Closing this as a duplicate so the discussion stays in one place. Please add your Android details there (chunking at |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The Android session should be able to read one message aloud with the system text-to-speech engine. Please add the control immediately beside the existing copy button.
The shared mobile UI lives in
apps/mobile. The copy control isCopyTextButton(apps/mobile/src/components/CopyTextButton.tsx).apps/mobile/src/features/threads/ThreadFeed.tsxplaces it in two spots:showAssistantMetais true, so a message that is still streaming has no copy button yet.Read the same string the copy button uses:
presentation.textfor a user message andrenderedTextfor an assistant message. This request is Android-only and usesandroid.speech.tts.TextToSpeech. iOS, cloud voices, and auto-reading a stream are out of scope.speak()accepts at mostTextToSpeech.getMaxSpeechInputLength()characters. The platform method returns 4000. A longer call does not read the rest. Split the message into chunks at or under that limit, on a paragraph or sentence boundary when one is nearby. Speak the first chunk withQUEUE_FLUSHand the rest withQUEUE_ADD, so one press reads the whole message in order.The same button pauses and resumes. Android TTS has no pause call, only
stop().stop()and keeps the character offset.AUDIOFOCUS_LOSSorAUDIOFOCUS_LOSS_TRANSIENT), treat that as the same pause and keep the offset.UtteranceProgressListener.onRangeStart(API 26+) reports the range inside the current chunk. The saved position is the chunk start plus that range start. Some engines never fireonRangeStart. In that case remember the start of the chunk that was playing, so resume still does not jump back to the first character.The icon should show speaking and paused. The accessibility label should say whether the next press reads, pauses, or continues.
Related, and closed: #3964 asked for a desktop read-aloud action. This request is the Android session control, including the character limit and resume after a pause or an interruption.
All reactions