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

A11y: VoiceOver: Properly end the active AVAudioSession when recording finishes, causing VO audio to be routed back to the main speaker instead of the earpiece. #6343

Merged
merged 2 commits into from
Jun 27, 2022

Conversation

robin24
Copy link
Contributor

@robin24 robin24 commented Jun 24, 2022

Issue Summary

When a VoiceOver user on iPhone records a voice message in Element, all VoiceOver speech and sounds are being routed to the earpiece instead of the main speaker once recording finishes.
This is quite a severe issue, as it makes VoiceOver almost unusable.

Problem Resolution

The cause of this issue is that currently, the AVAudiosession is not being ended properly, and is thus being kept active by the OS even after voice message recording has stopped.

This PR resolves this by calling
AVAudioSession.sharedInstance().setActive(false)
when recording ends.

Pull Request Checklist

  • I read the contributing guide
  • UI change has been tested on both light and dark themes, in portrait and landscape orientations and on iPhone and iPad simulators
  • Accessibility has been taken into account.
  • Pull request is based on the develop branch
  • Pull request contains a changelog file in ./changelog.d
  • You've made a self review of your PR
  • Pull request includes screenshots or videos of UI changes
  • Pull request includes a sign off

@robin24
Copy link
Contributor Author

robin24 commented Jun 24, 2022

Signed off by Robin Kipp [email protected]

@robin24 robin24 marked this pull request as ready for review June 24, 2022 17:08
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution Robin, LGTM 😎
I have a feeling this fixes a few other issues too!

@pixlwave pixlwave requested a review from stefanceriu June 27, 2022 15:57
Copy link
Member

@stefanceriu stefanceriu left a comment

Choose a reason for hiding this comment

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

Nice 👏 Thank you for fixing it!

@stefanceriu stefanceriu merged commit 560debe into element-hq:develop Jun 27, 2022
@robin24 robin24 deleted the avaudiosession branch June 28, 2022 13: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.

3 participants