With iOS 7 apple added the AVSpeechSynthesizer providing a simple text to speech synthesizer but there are some issues that can arise when using AVSpeechSynthesizer to enhance app accessibility.
Here are a couple of libraries (SSAccessibility and SSSpeechynthesizer) that provides a number of helpers to VoiceOver allowing you to use VoiceOver as an alternative to AVSpeechSynthesizer alllowing you to manage the queuing of different lines of text avoiding a number of issues that can arise when using AVSpeechSynthesizer.
The readme states why you might want to use VoiceOver (and SSSpeechSynthesizer):
– AVSpeechSynthesizer requires iOS 7
– AVSpeechSynthesizer doesn’t always pause or stop speaking when asked
– The user can set her preferred VoiceOver speaking rate in Settings.app, but there is no programmatic API access to that default speech rate — say, for use in your AVSpeechSynthesizer
– AVSpeechSynthesizer doesn’t stop speaking (only ducks) when VoiceOver starts, so two voices will be speaking at once
– The user can immediately (and intentionally or unintentionally) interrupt VoiceOver by tapping any element on screen
These libraries contain helpers for speaking text, enqueueing lines to be spoken after the current speaking, stopping speaking, continuing speaking, checking if there is currently speaking, and more.
You can find SSAccessibility and SSSpeechSynthesizer on Github here.
A nice set of helpers for accessibility.
- Tutorial: In Depth Tutorial And Example On Using The iOS Accessibility API
- Handy UIView Category Providing Layout Helper Methods (Z-Ordering, Absolute Positioning And More)
- Objective-C Utility Class Inspired By Underscore.js Providing Collection Helpers And More
- The Best Resources In iOS Development Sept.20 2010 (For Week Sept. 11- Sept. 17)
- In-App Purchase Library With A Blocks Based Syntax For Working With StoreKit And More
Original article: VoiceOver Helpers For Managing Lines To Be Spoken And Avoiding AVSpeechSynthesizer Issues
©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.