I'm trying to implement accessibility for an iOS App and have been bumping into some of the nuances and quirks involved.
For example: I have a label in my app that reads: "This is a live event." The definition of live in this context is "something that is currently happening" and when pronounced it should rhyme with "Five".
However, voiceover understands and reads the word "live" as in: "live and let die", and is mispronounced rhyming the word with "Give".
Similarly, another issue I am bumping into is with the word "ADD" in the context of "ADD A SELECTION". The meaning of the word in its context is "to add something to a basket", but is being pronounced as "A.D.D. (Attention deficit disorder)"
Is there a programatic way to give context to words when enabling your app for accessibility?
The solution - at least for iOS 9.1 and newer - changing the capitalisation of the word also changes the pronunciation:
- Live rhymes with five
- live rhymes with give
I've been struggling with this for a while but I found out a simple solution... If you add another "L" letter to the "Live" string it will pronounce live as five.
Try this --> "Llive"
Instead of using tips and tricks with capitals or doubled letters that currently work but may be obsolete in a future version of iOS, I suggest to use the accessibilitySpeechIPANotation
key inside an attributed string in order to define the appropriate phonetic sound (available since iOS11): this method is proven and will last in time.
Phonemes can be generated thanks to your mobile device settings:
- iOS 13:
Accessibility
-VoiceOver
-Speech
-Pronunciations
. - iOS 12:
General
-Accessibility
-Speech
-Pronunciations
.
They are two ways of bypassing a bug in a screenreader:
ignoring it : it's a bug in the screenreader, not in your code
using a different sentence.
For instance, you could say "this event is live" (if it works better, which i doubt), or "this event is on the air" (depending on the context of course, but you could fine a better alternative).
You might think about using aria-label
(for web apps, or its equivalent accessibilityLabel
in native application) to provide an audio alternative like "this is alive event" (because alive rhymes with five) for screenreaders but aria-label
is also used by braille display, and then this would be a quite bad idea.
As someone said in the comments above, screenreaders users know perfectly well how their screenreader would badly pronounce some words.
EDIT: See @Bugs answer for a solution on native iOS apps (>=iOS11)
You can set the accessibilityLabel
for the label to pronounce the text how you want.
For the OPs example:
label1.accessibilityLabel = @"This is a liv event." //notice live is spelled liv so it is pronounced for the correct context
label2.accessibilityLabel = @"add a selection"
This can also be done via the storyboard/nib by selecting the label and view the "identity inspector"
来源:https://stackoverflow.com/questions/36354498/voiceover-pronunciation-issue-live-add