xxxxxxxxxx
var bar = new p5.SpeechRec('en-US'); // this is a speech recognition object
bar.onResult = gotspeech; // this is a callback function
bar.continuous = true; // continuous recognition
bar.interimResults = true; // fragmented recognition
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
textSize(80);
bar.start(); // start the speech recognition
}
function draw() {
}
function mousePressed()
{
}
function gotspeech() {
background(255);
s = bar.resultString;
text(s, 0, height/2);
}