Skip to content

feat(chat): rework playback of voice messages and audio files - #6840

Open
minichhenoch-sir wants to merge 1 commit into
nextcloud:masterfrom
minichhenoch-sir:claude/admiring-hamilton-h19ffy
Open

minichhenoch-sir wants to merge 1 commit into
nextcloud:masterfrom
minichhenoch-sir:claude/admiring-hamilton-h19ffy

Conversation

@minichhenoch-sir

Copy link
Copy Markdown

Problem:
It was not possible to keep listening to audio in the background, and the playback speed of voice messages could not be changed.

What changes:

  1. Previously, every audio file was first downloaded completely and then played. Now it is streamed, so it starts playing while it is still loading, and you can keep working and writing in other apps and chats in the background.
  2. A player bar was added. Tapping it opens the full player with the playlist and the settings. Shuffle and repeat are only available for audio files, not for voice messages.
  3. Voice messages show a real waveform and are played one after another. The playback speed can be changed as well.

Tested:
Xiaomi Pad 7 Pro – Android 16
M301 MP3 Player – Android 9

Issues: #6093, #6408

AI:
Code and tests were created with Claude Code (Claude Opus 5.5).
I tested it myself on Nextcloud Hub 26 Spring (35.0.1). I defined the behavior of the points above and tested it on several devices.

🖼️ Screenshots

🏚️ Before 🏡 After
signal-2026-10-09-11-10-09-250 signal-2026-10-09-11-10-09-250_005
signal-2026-10-09-11-10-09-250_007 signal-2026-10-09-11-10-09-250_004
signal-2026-10-09-11-10-09-250_002 signal-2026-10-09-11-10-09-250_003

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI
  • Claude Opus 5.5

@minichhenoch-sir
minichhenoch-sir marked this pull request as ready for review October 9, 2026 09:50
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

The change adds shared Media3 playback for voice messages and audio files. It adds audio keys, queues, cached WebDAV data sources, metadata storage, waveform extraction, playback preferences, and service controls. Chat and conversation-list screens now expose player controls and message navigation. Message-level playback fields, the previous playback manager integrations, and the background voice-message card are removed.

Priority: ➖ Normal

Merge Risk: 🔵 Low · up to facd9

Account removal may leave audio metadata behind if the app stops during cleanup, and a quick track change may play the previous selection. These bounded issues should be addressed or explicitly accepted before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 18.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 251 functions across 45 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: reworking playback for voice messages and audio files.
Description check Passed The description explains the problem, summarizes the main changes, lists testing details and issues, includes screenshots, and completes the checklist and AI disclosure. The optional TODO section is m…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, summarizes the main changes, lists testing details and issues, includes screenshots, and completes the checklist and AI disclosure. The optional TODO section is missing, but the description is otherwise substantially complete.

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

✨ Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR

@minichhenoch-sir
minichhenoch-sir force-pushed the claude/admiring-hamilton-h19ffy branch from 2117395 to 595960c Compare October 9, 2026 10:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 77b41721-d573-4d30-9e5d-f90fb74fb575
📥 Commits

Reviewing files that changed from the base of the PR and between 2117395 and 595960c.

📒 Files selected for processing (5)
  • app/src/main/java/com/nextcloud/talk/chat/ChatActivity.kt
  • app/src/main/java/com/nextcloud/talk/chat/ui/model/ChatMessageUi.kt
  • app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt
  • app/src/main/java/com/nextcloud/talk/conversationlist/ConversationsListActivity.kt
  • app/src/main/java/com/nextcloud/talk/ui/chat/ChatView.kt
💤 Files with no reviewable changes (1)
  • app/src/main/java/com/nextcloud/talk/chat/viewmodels/ChatViewModel.kt

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

@minichhenoch-sir
minichhenoch-sir force-pushed the claude/admiring-hamilton-h19ffy branch from 595960c to a49f1f9 Compare October 9, 2026 21:23
@mahibi

mahibi commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Thank you @minichhenoch-sir , this looks pretty solid 👍
I only fixed the comment with passing the userId.
Other than that i tested and it works really good.
Claude only found minor points that dont have to be handled in this PR.

I wonder if we really want to have a shuffle feature. I dont see a usecase for a chat app that audiofiles are shuffled?

@rapterjet2004 Can you also have a look? Esp as you did a lot of things regarding voice messages

@minichhenoch-sir could you please let us know if it's okay that we take over e.g. for rebasing (and maybe fixing) or if you would like to do this?

rapterjet2004

This comment was marked as resolved.

@minichhenoch-sir

Copy link
Copy Markdown
Author

Thank you for testing and for the fix!

Yes, you are welcome to take over the PR, for rebasing and any fixes.

About shuffle: it is meant for people who are looking for an alternative to Telegram, where you can listen to music shared in chats.

@minichhenoch-sir

Copy link
Copy Markdown
Author

@rapterjet2004 Thanks for the review! Since you are welcome to take over, it would be great if you could include the change for account removal.

@mahibi

mahibi commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

@rapterjet2004 Thanks for the review! Since you are welcome to take over, it would be great if you could include the change for account removal.

Could you do this @rapterjet2004 ?
Could you also test that switching account works correct (forgot to test this)? In my opinion an audio should keep playing when switching accounts but clicking on it should switch back to the account and message.

This comment was marked as resolved.

@mahibi

mahibi commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

@rapterjet2004 will take over.
We will try to get this in quite soon

@rapterjet2004
rapterjet2004 self-requested a review October 19, 2026 18:59
coderabbitai[bot]

This comment was marked as off-topic.

Audio messages were downloaded completely before playback, their state
was mirrored into the chat messages and reset by list updates, taps on
another message were ignored while one was playing, the speed button had
no effect, and playback ignored audio focus and unplugged headphones.

VoiceMessageMediaService now streams audio messages through the app's
HTTP client into a size-limited disk cache and is the single source of
truth for chat audio. It handles audio focus, becoming noisy, wake locks
and retries after network errors, and exposes playback to the
notification, the lock screen and headsets. Voice messages continue with
the newer voice messages; audio files are played among the audio files
of the conversation and can be shuffled and repeated. The service only
accepts media items from Talk itself, and account credentials are only
sent to the WebDAV files of that account.

The chat and the conversation list observe the playback through
ChatAudioPlayer, a MediaController that is connected while the screen is
started. Tapping another message switches playback, seeking happens once
a drag ends, and a player bar shows what is playing, also for another
conversation. Tapping the bar opens a full player with seeking, previous
and next, speed, shuffle, repeat and the list of queued items, scrolled
to the current one. Speeds are kept per account and separately for voice
messages and audio files, and are shared between screens. Opening the
playing message, from the notification, the player bar or another chat,
switches to its account and opens the thread it was played in.

ChatAudioStore keeps durations, waveforms and the position of long
recordings. Waveforms are computed from the cached file once the player
has loaded it, so the file is not downloaded twice. Playback starts from
the persisted position once the metadata is loaded.

When an account is removed, by the user or by a remote wipe, playback of
its audio is stopped and unloaded, and its metadata is deleted from
memory and from the metadata cache.

Assisted-by: Claude Code:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Marcel Hibbe <dev@mhibbe.de>
Co-authored-by: rapterjet2004 <juliuslinus1@gmail.com>
Signed-off-by: Henoch Minich <301610408+minichhenoch-sir@users.noreply.github.com>
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
Signed-off-by: rapterjet2004 <juliuslinus1@gmail.com>
@rapterjet2004
rapterjet2004 force-pushed the claude/admiring-hamilton-h19ffy branch from facd907 to 76f1d47 Compare October 20, 2026 19:15
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.

4 participants