Using the Alex voice with AVSpeechSynthesisVoice: voiceWithLanguage

1k views Asked by At

Has anyone spelunked deep enough into the AVSpeechSynthesisVoice class and figured out how to use the Alex voice? - It does not show up in the list of voices returned by calling AVSpeechSynthesisVoice:speechVoices. I submitted a ticket to DTS and their response was:

Thank you for contacting Apple Developer Technical Support (DTS). Our engineers have reviewed your request and have concluded that there is no supported way to achieve the desired functionality given the currently shipping system configurations.

If you would like for Apple to consider adding support for such features in the future, please submit an enhancement request via the Bug Reporter tool at http://bugreport.apple.com.

Most of Apple's built in apps can use it like Notes and Reminders - but Safari will not use it. I don't really care if the solution is supported by Apple or not - this is for an in house app only.

Thanks!

1

There are 1 answers

2
Randal Bachin On

It will show up in a call to AVSpeechSynthesisVoice:speechVoices if the voice is available on the device.

To add the voice to your phone (I'm on iOS 10.3.2) go to: Settings/General/Accessibility/Speech/Voices/English/Alex and tap the cloud icon to download it.

Once it's downloaded you can list out the voices like this:

// Swift 3 
let voices = AVSpeechSynthesisVoice.speechVoices()
for szVoice in voices {
  print(szVoice)
}

It shows up as the last name in the list.

[AVAlexSpeechSynthesisVoice 0x1700150d0] Language: en-US, Name: Alex, Quality: Enhanced [com.apple.speech.voice.Alex]