Briahas
12/1/2017 - 8:55 AM

VoiceList

VoiceList

func prepareVoiceList() {
    for voice in AVSpeechSynthesisVoice.speechVoices() {
        let voiceLanguageCode = (voice as AVSpeechSynthesisVoice).language
 
        let languageName = NSLocale.currentLocale().displayNameForKey(NSLocaleIdentifier, value: voiceLanguageCode)
 
        let dictionary = ["languageName": languageName, "languageCode": voiceLanguageCode]
 
        arrVoiceLanguages.append(dictionary)
    }
}