fix: 🐛 Implement logic to manage voice message playback during recording and manage currently playing voice messages#420
Merged
dhyash-simform merged 1 commit intomainfrom Jan 15, 2026
Conversation
3ebbb65 to
3a2444d
Compare
3a2444d to
df5b7a7
Compare
There was a problem hiding this comment.
Pull request overview
This PR introduces a centralized AudioManager singleton to manage voice message playback across the chat application. The implementation prevents multiple voice messages from playing simultaneously and automatically stops playback when recording begins, resolving issue #398.
Key Changes:
- Added
AudioManagersingleton class to centrally manage audio playback state - Modified voice message playback logic to use AudioManager instead of direct controller calls
- Implemented automatic playback stop when voice recording starts
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| lib/src/utils/audio_manager.dart | New singleton class managing global audio playback state, ensuring only one voice message plays at a time |
| lib/src/widgets/voice_message_view.dart | Integrated AudioManager for play/pause operations and added cleanup in dispose to prevent memory leaks |
| lib/src/widgets/chatui_textfield.dart | Added call to stop all audio playback before starting voice recording |
| CHANGELOG.md | Documented the breaking change with reference to PR #398 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
df5b7a7 to
8e83a48
Compare
955f7ec to
6ccb238
Compare
dhyash-simform
requested changes
Jan 13, 2026
67fcef0 to
992b6f8
Compare
992b6f8 to
735e48f
Compare
…ding and manage currently playing voice messages
735e48f to
c3ebf3e
Compare
dhyash-simform
approved these changes
Jan 15, 2026
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.
Description
Before:
old.mov
After:
Screen.Recording.2026-01-13.at.5.53.32.PM.mov
Checklist
fix:,feat:,docs:etc).docsand added dartdoc comments with///.examplesordocs.Breaking Change?
Related Issues
Closes #398