xxxxxxxxxx
20
// SpeakAll (c) 2015,2022 kouichi.matsuda@gmail.com
let speech; // 音声合成用のオブジェクト
function setup() {
speech = new p5.Speech(); // 音声合成用のオブジェクトの
let button = createButton("順に発話")
button.mousePressed(speak); //
}
function draw() {
}
let num = 0;
function speak() {
print(num);
speech.setVoice(num); //
speech.speak("I'm sorry Dave, I'm afraid I can't do that.");
num = (num + 1) % speech.voices.length;
}