-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
* say async play #26
* say async play #26
Conversation
* UI not blocking
@@ -57,6 +57,8 @@ class ViewController: NSViewController { | |||
let voiceSavePanel = NSSavePanel() | |||
/// Open panel for "Open" menu | |||
let textOpenPanel = NSOpenPanel() | |||
|
|||
var sayObj: Say! = nil; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think instance variable is not nessessary here. Swift will capture the variable into the dispatch queue blocks.
@@ -92,10 +94,22 @@ class ViewController: NSViewController { | |||
|
|||
@IBAction func say(_ sender: NSControl) { | |||
sender.isEnabled = false | |||
Say(text: self.textForSpeech, voice: self.selectedVoice).play(true) | |||
sender.isEnabled = true | |||
self.sayObj = Say(text: self.textForSpeech, voice: self.selectedVoice) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider to use local variable say
instead of self.sayObj
.
Generally in apple environment, we don't like to use abbr like 'Obj'.
This patch is perfect except for the naming and scope issues. Thanks for nice work. |
…_play # Conflicts: # Say/ViewController.swift
I am sorry but now it is fixed in other patches. Will you check it? |
I close this pull request |
Play the Say UI not blocking
Turned to the play async say
issue : #2
@youknowone