Skip to content

Instantly share code, notes, and snippets.

@versluis
Last active July 22, 2016 22:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save versluis/8cf4f63cbe003e2fd8026c8fa34f607f to your computer and use it in GitHub Desktop.
Save versluis/8cf4f63cbe003e2fd8026c8fa34f607f to your computer and use it in GitHub Desktop.
Checks if the Alex voice is installed on iOS.
- (void)checkForAlex {
// is Alex installed?
BOOL alexInstalled = NO;
NSArray *voices = [AVSpeechSynthesisVoice speechVoices];
for (id voiceName in voices) {
if ([[voiceName valueForKey:@"name"] isEqualToString:@"Alex"]) {
alexInstalled = YES;
}
}
if (alexInstalled) {
NSLog(@"Alex is installed on this device.");
} else {
NSLog(@"Alex is not installed on this device.");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment