Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VoiceOver accessibility in a virtual musical instrument iPhone app?

I have received comments from blind users that some of my sound and music related apps only work with VoiceOver off.

With VoiceOver Accessibility enabled on an iOS device, is it possible to enable a music keyboard or drum pad touch area so that music sounds can be played immediately, instead of VoiceOver prompts, when a keyboard key or virtual drum set (etc.) is tapped?

Just setting the UIAccessibilityTraitPlaysSound AccessibilityTrait on a UIView subview doesn't seem to do it. I get VoiceOver clicking instead of piano or drum sounds with VoiceOver enabled.

A blind user can turn VoiceOver completely off, but then all the other buttons (Instrument selection, Configuration, Help, etc.) and/or controls will no longer will have VoiceOver assistance.

like image 898
hotpaw2 Avatar asked May 04 '11 16:05

hotpaw2


People also ask

How do I add VoiceOver in Swift?

The quickest way to use VoiceOver is to open the Settings app on your iOS device, select Accessibility ▸ Accessibility Shortcut then select VoiceOver. This creates a shortcut so you can triple-tap the home button — or the side button, for newer phones — on a physical device to toggle VoiceOver on and off.


1 Answers

I can now answer my own question.

iOS 5 has added a new API exactly for this need:

[ mySubView setAccessibilityTraits: UIAccessibilityTraitAllowsDirectInteraction ];

will disable VoiceOver just for that UIView subview, but leave other subviews (other buttons, etc.) unaffected. This API allows an app to get responsive touch handlers more suitable for keying a musical instrument within the specified subview, even with VoiceOver enabled and providing assistance for other portions of the app's UI outside the specified UIView.

like image 146
hotpaw2 Avatar answered Sep 23 '22 22:09

hotpaw2