iOS Accessibility and VoiceOver helpers, including a VoiceOver speech synthesizer.
SSAccessibility
powers a speech synthesizer in my app MUDRammer - A Modern MUD Client for iPhone and iPad.
Install with CocoaPods. Add to your Podfile
:
pod 'SSAccessibility', :head # YOLO
SSSpeechSynthesizer
manages a queue of lines of text, speaking one at a time with VoiceOver, then speaking the next line when speaking finishes.
The user can interrupt speech by tapping any element on screen that is announced by VoiceOver.
Check out the Example
project to see it in action.
You should if you can. AVSpeechSynthesizer
is good for speaking long blobs of text. But there are reasons to prefer VoiceOver:
AVSpeechSynthesizer
requires iOS 7AVSpeechSynthesizer
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 for speaking with
AVSpeechSynthesizer
AVSpeechSynthesizer
doesn't stop speaking (only ducks volume) when VoiceOver starts, so two voices will be speaking at once- The user can immediately interrupt VoiceOver by tapping any accessible element on screen
Accessibility helpers. See SSAccessibility.h
.
// Speak some text with VoiceOver. This is a shortcut for UIAccessibilityPostNotification.
[SSAccessibility speakWithVoiceOver:@"Hello world!"];
SSAccessibility
is a @jhersh production -- (electronic mail | @jhersh)