Create a gist now

Instantly share code, notes, and snippets.

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