Skip to content

Instantly share code, notes, and snippets.

@myrickchow32
Last active January 28, 2019 13:45
Show Gist options
  • Save myrickchow32/f7c5ba616fdbea801416e3535b000dbf to your computer and use it in GitHub Desktop.
Save myrickchow32/f7c5ba616fdbea801416e3535b000dbf to your computer and use it in GitHub Desktop.
// Utterance contains with both English and Traditional Chinese words
let utterance = AVSpeechUtterance(string: "Hong Kong(香港)is in Asia.")
utterance.voice = AVSpeechSynthesisVoice(language: "zh-HK")
let avSpeechSynthesizer = AVSpeechSynthesizer()
avSpeechSynthesizer.speak(utterance)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment