Date and Time Assistant

I wanted to experiment with the idea of an autonomous Machine Learning Model that is capable of giving you the real time and date when listening to certain sound commands. My goal was to recreate something like this and connected to a visualizer in p5.js that is able to portray that time and date in real time.

Training the model

The first challenge was to train the model with the sound of my voice and the word commands to be listened for it to act. First I had to record background noise as a reference. I recorded 3 different background noises to be part of the same class so it also recognizes distant background voices as part of the overall noise floor.

Secondly, I had to record the first phrases that represented the “Time” class. These phrases were something on the realm of: “what is the time?”, “what is your time”, “can you give me the time?”, “give me your time”, etc. I recorded some samples for this class and then I recorded the date class samples with a similar approach.

Captura de Pantalla 2026-02-06 a la(s) 2.40.37 p.m..png

training.mov

Once my model was trained it was the perfect moment to write my p5.js sketch and use functions like hour(), minute(), second(), year(), month() and day() to get the data for the current value of those through p5.js. I also searched for a font in google fonts that I liked and used it as part of my assets.

One important thing to add is that I had to create a variable called options that allowed me to add a threshold value for the model for it to behave better with the input sound coming from my microphone. If I did not add these, the model was just behaving like crazy just randomly changes because the default value for that probabilityThreshold is cero. The lines I used were the following:

let options = { probabilityThreshold: 0.8 };

myModel = ml5.soundClassifier(modelURL, options);

test.mov

The screen recording looked like this.

Grabación de pantalla 2026-02-06 a la(s) 4.07.09 p.m..mov

Here is the final code of this date and time assistant.

https://editor.p5js.org/giav2030/sketches/vYdRud0Yu

Reading notes…

Who has the power to label images and how do those labels and machine learning models trained on them impact society?