Question

This drove me nuts, so I thought I'd document the answer here.

To choose a voice, you give -[NSSpeechSynthesizer initWithVoice] the identifier in reverse-DNS format, e.g. com.apple.speech.synthesis.voice.Agnes But if a user downloads one, such as Paolo, you can't get to it the same way.

Was it helpful?

Solution

The answer turns out to be that Apple names it "voice.premium", so you get to Paolo with com.apple.speech.synthesis.voice.paolo.premium. So even though I got the list of [NSSpeechSynthesizer availableVoices], I only printed out the last word, and I didn't notice premium added to the list. To get the real printable name of a voiceIdentifier in availabVoices,(instead of looking at the last word), use:

[[NSSpeechSynthesizer attributesForVoice:voiceIdentifier] 
    valueForKey: NSVoiceName] 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top