ADC microphone On Robot Hat v4

Are there Vilib or robot hat packages to access a microphone connected to the ADC pins on Robot hat v 4? I’d like to set up 4 mics, front, right and left, back so that if I call out a voice command the robot will be able to detect where the signal is strongest and turn in that direction.

I tried that, with 2 microphones it did not work. I could not get the distance between microphones far enough apart to be able to get it to work given the relatively high speed of sound , nor eliminate the impact of echoes in a real room environment.

Which package did you use?

I’m not aware of any prebuilt packages to do this. I simply coded up several algorithms as published in various papers found on the web. They all worked quite well with the given data sets, but not in the real world.

If it can help you to progress, then just FYI the 2 main problems that I could not resolve were:

  1. Room acoustics made the signals arriving at each microphone quite different, making cross correlation unreliable. A constant tone wasn’t too bad, but speech simply didn’t work robustly.

  2. The lack of a RTOS meant that the variability of signal capture time was greater than the sound flight time between microphones.

You may be able to use something like an extenal arduino with a RTOS and/or use a simple instantaneous sound like a clap as per Sunfounder’s dedicated sound direction module.

Did you convert it to digital before testing the data?