Skip to content

Instantly share code, notes, and snippets.

@myrickchow32
Last active January 21, 2019 14:51
Show Gist options
  • Save myrickchow32/c91062bc4ec45b769acb97d92929762f to your computer and use it in GitHub Desktop.
Save myrickchow32/c91062bc4ec45b769acb97d92929762f to your computer and use it in GitHub Desktop.
let speechVoices = AVSpeechSynthesisVoice.speechVoices()
speechVoices.forEach { (voice) in
print("**********************************")
print("Voice identifier: \(voice.identifier)")
print("Voice language: \(voice.language)")
print("Voice name: \(voice.name)")
print("Voice quality: \(voice.quality.rawValue)") // Compact: 1 ; Enhanced: 2
}
/*
Example output:
**********************************
Voice identifier: com.apple.ttsbundle.Karen-compact
Voice language: en-AU
Voice name: Karen
Voice quality: 1 <- Compact voice track
**********************************
Voice identifier: com.apple.ttsbundle.Karen-premium
Voice language: en-AU
Voice name: Karen (Enhanced)
Voice quality: 2 <- Enhanced voice track
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment