say.js
say.js copied to clipboard
Speak and Export methods should be promises
Both the .speak()
and .export()
methods should accept a callback or return a promise if the callback is missing.
I love it, just made something like it:
let getNextSaying = (text) => () => {
return new Promise(resolve => {
console.log(`Speaking ${text} ..`)
say.speak(text, "Good News", 1.0, resolve)
})
}
currentSpeakingIsOver = currentSpeakingIsOver.then(getNextSaying(action.payload))
Also - on Windows I'm not sure the promise truly waits for the first to be over.. It could be the OS reports back sooner than the speech finishes - got any confirmation on that?
@deanius I'm unfamiliar with how say works with Windows. Can you create a separate issue?
@tlhunter - Yes I'll try and keep you posted - a few quirks I'm noticing, but don't have a minimal repro yet..