Last active
July 22, 2016 22:43
-
-
Save versluis/8cf4f63cbe003e2fd8026c8fa34f607f to your computer and use it in GitHub Desktop.
Checks if the Alex voice is installed on iOS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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