Last active
February 11, 2019 08:19
-
-
Save myrickchow32/607193600f61017956f72ae09971ad73 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func getUtterance(_ speechString: String) -> AVSpeechutterance { | |
| let utterance = AVSpeechUtterance(string: speechString) | |
| utterance.voice = ... | |
| utterance.rate = ... | |
| utterance.pitchMultiplier = ... | |
| utterance.volume = ... | |
| utterance.preUtteranceDelay = ... | |
| utterance.postUtteranceDelay = ... | |
| return utterance | |
| } | |
| let avSpeechSynthesizer = AVSpeechSynthesizer() | |
| avSpeechSynthesizer.speak(getUtterance("First String")) | |
| avSpeechSynthesizer.speak(getUtterance("Second String")) | |
| avSpeechSynthesizer.speak(getUtterance("Third String")) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment