xxxxxxxxxx
var speak;
function setup() {
createCanvas(windowWidth, windowHeight);
// speech synthesis object
speak = new p5.Speech();
speak.onLoad = voicesLoaded;
}
function voicesLoaded(){
// debugging statement
// Lists available synthesis voices to the JavaScript console.
// only works when voices are loaded
speak.listVoices();
speak.setVoice('Google Deutsch');
speak.setLang('de-DE');
speak.setPitch(1);
speak.setRate(1);
speak.setVolume(1);
speak.interrupt = false;
}
function draw(){
background(0);
fill(255);
textSize(100);
textAlign(CENTER, CENTER);
text("Click to speak", width/2, height/2);
}
function mousePressed() {
speak.speak('Hallo. Ich bin Eure Roboterstimme!');
}