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
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.
Why not use iOS 7's
You should if you can.
AVSpeechSynthesizer is good for speaking long blobs of text. But there are reasons to prefer VoiceOver:
AVSpeechSynthesizerrequires iOS 7
AVSpeechSynthesizerdoesn'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
AVSpeechSynthesizerdoesn'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
// Speak some text with VoiceOver. This is a shortcut for UIAccessibilityPostNotification. [SSAccessibility speakWithVoiceOver:@"Hello world!"];