Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. // Set URL to save file to disk
  2. if let speechFileURL = NSURL(string: speechFilePath) {
  3. speechSynth.startSpeakingString(spokenText, toURL: speechFileURL) // Speak to file
  4. }
  5. else {
  6. dialogAlert("Invalid File: ", text: speechFileName)
  7. }
  8.  
  9. while(NSSpeechSynthesizer.isAnyApplicationSpeaking() == true) {
  10. if self.gUserClickedStop {
  11. speechSynth.stopSpeaking()
  12. self.gIsSpeaking = false
  13. break
  14. }
  15. }
  16.  
  17. dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0)) { [unowned self] in
  18. self.parseTheScript()
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement