xxxxxxxxxx
33
// Uses a MODEL to listen for specific words
const classifier = startListening();
// Numbers we the flower to use before it detects sound
let dotSize = 0;
let shapeNumber = 0;
function setup() {
// noLoop();
createCanvas(400, 400);
// frameRate(60);
background('rgb(25,180,210)');
initialize();
}
function draw() {
// flower() is a function that wants two pieces of information
// the first one is a number between 1 and 9 to determine the size of the dots
// the second one is a number between 1 and 9 to determine the shape number
flower(dotSize, shapeNumber);
}
// Changed the name of the function. We can pick something that is meaningful
function showMeConfidenceLevel(error, result) {
let label = result[0].label;
let confidence = result[0].confidence;
printFeedback(label, confidence);
dotSize = convertLabelToNumber(label);
// shapeNumber = dotSize;
shapeNumber = random(1, 9);
}