skip to Main Content

Is it possible to enable/disable VoiceOver speech/spoken hints on all items/entirely temporarily? In our App, we have a recording function and VoiceOver doesn’t stop talking during recording and the speech gets recorded.

I would like to know if there is a way.

2

Answers


  1. Chosen as BEST ANSWER

    Couldn't achieve above, but wrote a workaround. It no longer announces when recording is started (or when we enter recording view) but still works if user one presses a button.

    // We want to avoid automatic VoiceOver announcement in this view
    // Otherwise it's announced during recording
    let decoyView = UIView()
    decoyView.isAccessibilityElement = true
    decoyView.accessibilityTraits = .none
        
    // Order accessibility elements, VoiceOver announces first element due to auto focus
    self.view.accessibilityElements = [decoyView, yourViewItems]
    

    The problem happened because when user presses Record, the app enters a new view, which VoiceOver automatically focuses the first accessibility element in that view.


  2. Try using the startsMediaSession trait on the button that starts the recording , which will tell VoiceOver to stop announcing its speech output while the recording is being made.

    myButton.accessibilityTraits.insert(.startsMediaSession)
    

    Use this trait to silence the audio output of an assistive app, such as VoiceOver, during a media session that you don’t want to interrupt. For example, you might use this trait to silence VoiceOver speech while the user is recording audio.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search