Closed shiffman closed 6 years ago
It actually was _dv instanceof Function
before, but I sead it's actually typeof
.
Dan has got another example using p5.SpeechRec
:
speechRec = new p5.SpeechRec(gotSpeech);
let continuous = true;
let interimResults = false;
speechRec.start(continuous, interimResults);
function gotSpeech(speech) {
console.log(speech);
if (speech.success) {
createP(speech.text);
}
}
, And it's got the same problem.
I sorted this out and will just use the API as is, thanks for your patience!
Hi @rev3rend, thanks again for helping me understand the library this morning. I have one example where I want to pick a random new voice, so I am not setting a voice initially but I do want a callback for when the voices are available, i.e.:
How do you feel about adding this extra one line check for the
p5.Speech
constructor?Alternatively I can just write my code like so which is ok too:
Let me know which you prefer and I can adjust my example or submit a pull request with just the one line.