https://editor.p5js.org/SihongShen/sketches/kmKf-mV51
https://teachablemachine.withgoogle.com/models/nyKXUUTBW/
During the training, I noticed that the model can’t really tell the difference between clap and snap the fingers at first, so I recorded more samples and made samples for each type more diverse, and now the model behaves better, though it sometimes still mistake snap as clap.
I adapted the example codes for ml5js + teachable machine for sound to connect the model.
The reaction for the ball is simple, using if-else and functions.