Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playback speed control to voice messages #4482

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arkascha
Copy link
Contributor

@arkascha arkascha commented Nov 25, 2024

This is an implementation of the feature request in issue 3786:
"Allow voice messages to be played at different speeds"

This PR should not be considered final. There are a few questions to be answered first, I cannot do that myself, however. I need someone from inside the project for that. So this is more a "request for comment" than a PR ;-)

The current implementation does not at all offer a fancy design. The UI is as simplistic as possible.
I could very well imagine a button that extends when clicked and offers the options in parallel instead of cycling through the offered options as it is currently implemented. But that certainly is something a design expert has to decide.

The current implementation has 4 speeds it offers (opposed to WhatsApp offering 3): 0.8x, 1.0x, 1.5x, 2.0x. I added the slow variant since that could sometimes help to understand messages with bad acoustics.
The chosen speed is persisted on a per-user base. This appeared intuitive to me, since usually individual users keep their typical talking speed. Which means that if there is a need to change the playback speed that change probably makes sense for all voice messages of that user.

I would need some advice about the testing strategy in this project ... When trying to implement tests I found that next to no tests and test structure exist. I assume I miss something here ...

Seems I found a bug in how the message view holders are handled: their onBind() method is called over and over again when a voice message is played. That might be triggered by updating the progress slider. This behaviour repaints the view holder millions of times which actually creates quite a load on the system ...

I am thankful for any feedback on this!

🖼️ Screenshots

🏚️ Before 🏡 After
screenshot_nextcloud-andoird-talk-voice-message-before screenshot_nextcloud-andoird-talk-voice-message-after

🚧 TODO

  • decide about design requirements or requests for the new button
  • clearify state of unit and instrumented tests
  • decide what to do with pre existing onBind() bug in message holders
  • Translations

🏁 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?)

@arkascha arkascha force-pushed the issues-334-allow-voice-messages-to-be-played-at-different-speeds branch from f45dbe4 to c5c716b Compare November 27, 2024 16:45
@AndyScherzinger AndyScherzinger added enhancement New feature or request 3. to review Waiting for reviews labels Nov 27, 2024
@arkascha arkascha force-pushed the issues-334-allow-voice-messages-to-be-played-at-different-speeds branch from 0e27404 to 898cd0e Compare November 27, 2024 19:31
@arkascha
Copy link
Contributor Author

@rapterjet2004 It seems we had a mid air collision ... I received an email message pointing to a commit you added, but I cannot find that commit. I am afraid I suppressed it by a force push I made inside my repository from where I created this PR. Sorry for that, I did not expect it is possible to add a commit to a PR, that is a new concept for me. Could you please cherry-pick that commit again?
Sorry!

@arkascha arkascha force-pushed the issues-334-allow-voice-messages-to-be-played-at-different-speeds branch from 898cd0e to 6410dae Compare November 27, 2024 19:50
Signed-off-by: Christian Reiner <[email protected]>

Themed the PlaybackSpeedControl + Work around onBind bug

Signed-off-by: rapterjet2004 <[email protected]>
@rapterjet2004 rapterjet2004 force-pushed the issues-334-allow-voice-messages-to-be-played-at-different-speeds branch from 6410dae to c97933b Compare November 29, 2024 17:10
@arkascha
Copy link
Contributor Author

Is there anything that needs to be done on my side?
As far as I can tell the failed checks are caused by issues completely independent from this branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants