xxxxxxxxxx
var foo = new p5.Speech();
var t = '';
var r;
var g;
var b;
var a;
function setup() {
createCanvas(windowWidth, windowHeight);
background(200);
var box = createInput('');
box.position(80,80);
box.style('height','30px');
box.size(200);
box.style('font-size','18px');
box.input(boxtyped);
}
function keyPressed(){
if (keyCode===ENTER)
{
foo.speak(t);
background(200);
textSize(random(60,130));
r = random(255);
g = random(255);
b = random(255);
a = random(100,120);
fill(r,g,b,a);
text(t,random(width),random(height));
}
}
function boxtyped()
{
t = this.value();
}