VoiceOver pronunciation issue: “Live” “ADD”

梦想与她 提交于 2019-12-05 01:53:17

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"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!