xxxxxxxxxx
25
//Thanks for the tutorials, ml5 and The Coding Train! ❤️
var classifier
function preload(){
var options = { probabilityThreshold: 0.7 };
classifier = ml5.soundClassifier('SpeechCommands18w', options)
}
function setup() {
createCanvas(400, 400);
classifier.classify(gotResults);
}
function draw() {
background(220);
}
function gotResults(error, results){
if (error){
console.log("oops")
console.log(error)
}
console.log(results[0].label)
}