Skip to content

fix: 🐛 Implement logic to manage voice message playback during recording and manage currently playing voice messages#420

Merged
dhyash-simform merged 1 commit intomainfrom
fix/manage-audio-players
Jan 15, 2026
Merged

fix: 🐛 Implement logic to manage voice message playback during recording and manage currently playing voice messages#420
dhyash-simform merged 1 commit intomainfrom
fix/manage-audio-players

Conversation

@japanshah-simform
Copy link
Contributor

@japanshah-simform japanshah-simform commented Dec 22, 2025

Description

Before:

old.mov

After:

Screen.Recording.2026-01-13.at.5.53.32.PM.mov

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Closes #398

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 AudioManager singleton 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.

@japanshah-simform japanshah-simform force-pushed the fix/manage-audio-players branch from df5b7a7 to 8e83a48 Compare January 9, 2026 09:36
@SimformSolutionsPvtLtd SimformSolutionsPvtLtd deleted a comment from Copilot AI Jan 9, 2026
@SimformSolutionsPvtLtd SimformSolutionsPvtLtd deleted a comment from Copilot AI Jan 9, 2026
@SimformSolutionsPvtLtd SimformSolutionsPvtLtd deleted a comment from Copilot AI Jan 9, 2026
@SimformSolutionsPvtLtd SimformSolutionsPvtLtd deleted a comment from Copilot AI Jan 9, 2026
@japanshah-simform japanshah-simform force-pushed the fix/manage-audio-players branch 9 times, most recently from 955f7ec to 6ccb238 Compare January 13, 2026 11:27
@japanshah-simform japanshah-simform force-pushed the fix/manage-audio-players branch 7 times, most recently from 67fcef0 to 992b6f8 Compare January 15, 2026 05:31
…ding and manage currently playing voice messages
@dhyash-simform dhyash-simform merged commit d5d4668 into main Jan 15, 2026
1 check passed
@dhyash-simform dhyash-simform deleted the fix/manage-audio-players branch January 15, 2026 10:01
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.

Voice Notes Record and Play

3 participants