Close

Notes on Voice Integration

A project log for Choose your own adventure bot

Ultra low cost 3D printed Open Educational Resource Walking Robotic Platform

shanesnipeshane.snipe 08/14/2021 at 11:520 Comments

Slack messages from Doug....

I watched and read the Edge Impulse tutorials on recognizing spoken keywords yesterday. So I decided I needed to get the INMP441 microphone working. It turns out the just (July 5th) added I2S to MicroPython, and it has changed a bunch since the online examples. I made some progress, but it was very slow. This morning I joined the MicroPython forum and posted a question about it. Hopefully once the moderator approves my post I will get some answers!

I'm excited - I finally got the microphone to spit out some data! I don't yet have a way to tell if it is valid, but I see data output on the oscilloscope and data shows up in a memory buffer. Previously the buffer was full of zeros. And the data doesn't show up until I import my microphone.py script.

I had to change one of the pin connections to the microphone. Instead of L/R GPIO14 has to go to WS on the microphone. L/R can be a no-connect for mono input.

I got several answers on the MicroPython forum. One included a program to read data from the microphone and store it in a file on the ESP32. I ran the program, then spent a couple hours trying to get the file off the ESP. I ended up changing from AMPY to RSHELL to communicate with the ESP and that worked. The file did indeed have my "hello, hello, hello!" in it, although it was rather faint. So, the microphone works! I then went through the Edge Impulse stuff and generated several programs that should be able to recognize "yes" or "no". The output is rather complicated, so I have a lot of work to do to connect the recognizer to the microphone, but that's what's next.

So I signed up on EdgeImpulse and created my first "Impulse" to recognize "ON" or "OFF" being spoken. I generated files for an Arduino Nano 33 BLE Sense and downloaded them. Then I compiled them using the Arduino IDE. It took over 10 minutes, but they compile! This version loads data (speech) from a static buffer and tries to decide if it is "ON", "OFF", or other. That means it doesn't continuously monitor voice input. There is a sample that does. I have a Nano 33 on the way - Monday. I want to try this out on a supported board before I try it on the MH-ET. It is a massive amount of code, so I want to get the process down before I try diverging to the ESP. Sadly, no ESP boards are on the supported list, although I think the ESP32 has enough power and memory to do this.

Discussions