How to check if the Alex Voice is installed in iOS

Alex is Apple’s high-quality voice that users can download and use with VoiceOver and any text-to-speech application, including the native AVSpeechSynthesizer methods.

However, Alex is an optional file that users can download if they wish, and he’s rather large too (about 900MB). Hence we can’t rely on this voice being available.

While your iOS app can request to play an utterance using Alex, iOS will default to the low-quality standard voice if Alex is not available. So how can we check if he’s around?

Here’s a quick method that lets us do just that: it checks if the Alex voice as been downloaded to the device, and lets you react accordingly – perhaps by letting the user know that an enhancement is available and how to get it:

This method loops through all installed voices and queries each voice’s name. If Alex is among them, he’s installed. You can also query other names (each voice has a name identifier), and if an “enhanced” version is available using the “quality” parameter ( 1 = standard, 2 = enhanced).

Query the “language” parameter to see which languages are available for speech on the current device (returns a language code like en-US).

For testing: here’s a quick method that writes all available voice names and parameters out as log messages: