3

In Daniel Devesa Derksen-Staats' book 'Developing Accessible iOS Apps', the following example is included to show how IPA (International Phonetic Alphabet) notation can be used to specify the VoiceOver pronunciation:

let ipaAttributedText = NSMutableAttributedString(string: "Paella is a Valencian rice dish")
let ipaRange = ipaAttributedText.string.range(of: "Paella")!
ipaAttributedText.addAttributes([.accessibilitySpeechIPANotation: "paˈeʎa"], range: NSRange(ipaRange, in: ipaAttributedText.string))
ipaLabel.attributedText = ipaAttributedText
// Excerpt From: Daniel Devesa Derksen-Staats. “Developing Accessible iOS Apps.” Apple Books.

The result, at least in iOS 15, is clearly not what was intended. The accessibility label, as it appears in the VoiceOver caption is "ipa, Paellais a Valencian rice dish" - and this is how it is read. The VoiceOver synth's pronunciation is roughly 'paylace', that is, it is completely ignoring the phonetic transcription (I can replace "paˈeʎa" with literally anything, the pronunciation doesn't change). Also any whitespace between the target word and what follows is deleted in the caption and pronunciation. In the console, I can output the value of the ipaAttributedText, everything there looks ok:

Paella{
    UIAccessibilitySpeechAttributeIPANotation = "pa\U02c8e\U028ea";
}    is a Valencian rice dish{
}

This blog post contains a very similar example, differing only in that it sets the .accessibilityAttributedLabel instead of .attributedText, but it fails in the same way.

Is this broken on iOS 15? or is there something else needed to make this work?

c_booth
  • 2,185
  • 1
  • 13
  • 22
  • Take a look at https://a11y-guidelines.orange.com/en/mobile/ios/development/#speech-synthesis in the 'phonemes' sheet. – XLE_22 Dec 17 '21 at 15:17
  • However, I have a problem of pronunciation in french with the IPA notation since iOS15. I wrote to the Apple accessibility support that is able to reproduce the problem and has let the engineering team know... and nothing else. ‍ I'm convinced the problem is their part, we just have to wait unfortunately: this is a huge bug of this release in my view. – XLE_22 Dec 17 '21 at 15:23
  • 2
    @XLE_22 That technique for phonetic transcription is indeed very cool - but as I stated in my post, the transcription string provided to .accessibilitySpeechIPANotation is entirely ignored (I also tried using the device generated transcription from the phonemes sheet). I will also reach out to Apple, as this does seem to be a bug in iOS 15 – c_booth Dec 17 '21 at 15:44

0 Answers0