Skip to content

feat: add replay TTS audio button in WalkieTalkie and Conversation modes#183

Merged
niedev merged 2 commits into
niedev:v2.00from
NikolaCavendish:v2.00
May 26, 2026
Merged

feat: add replay TTS audio button in WalkieTalkie and Conversation modes#183
niedev merged 2 commits into
niedev:v2.00from
NikolaCavendish:v2.00

Conversation

@NikolaCavendish
Copy link
Copy Markdown
Contributor

@NikolaCavendish NikolaCavendish commented May 16, 2026

Summary

Implemented manual TTS playback functionality for both WalkieTalkie and Conversation modes, allowing users to conveniently replay translated messages via a speaker icon. Integrated a precise cross-process onTTSDone callback mechanism for accurate UI state synchronization.

Details

  • UI Enhancements: Added a speaker icon to each message bubble in WalkieTalkie and Conversation modes. Tweaked text containers with layout_weight="1" in component_message_send.xml and component_message_received.xml to prevent long translated texts from overlapping the icon.
  • Precise IPC Callback: Introduced a new ON_TTS_DONE command in VoiceTranslationService. This implements a highly accurate native UtteranceProgressListener.onDone event propagation to keep the UI perfectly synchronized with the audio playback state.
  • Utterance ID Tracking: Updated VoiceTranslationServiceCommunicator to attach a unique utteranceId (timestamp-based) during speakText calls. The UI correctly identifies the finished playback and resets the stop icon back to the play icon.
  • Backward Compatibility: Maintained system stability by providing a default empty implementation of onTTSDone in the base VoiceTranslationServiceCallback, and safely overloaded the speak() method to prevent breaking existing auto-translation logic in WalkieTalkieService and ConversationService.

Other

None

@niedev
Copy link
Copy Markdown
Owner

niedev commented May 18, 2026

Hi @NikolaCavendish, thank you very much for your contribution!
In the next days/weeks, I will review the PR.

@niedev niedev self-requested a review May 25, 2026 14:32
@niedev niedev self-assigned this May 25, 2026
Copy link
Copy Markdown
Owner

@niedev niedev left a comment

Choose a reason for hiding this comment

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

Very good job! The only thing missing is the state management of the TTS inside the Service, but now I will do changes to the TTS logic, so it is better this way. I will directly implement the state management with the new logic, but this is a good base for everything else.
Now I will merge the PR, thank you again for your contribution!

@niedev niedev merged commit 69cfbbd into niedev:v2.00 May 26, 2026
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