Accessing mic array


#1

I’m looking for examples using the microphone array. Is it just I2S? If so, what microphones are on what channel and how do I use the LEDs? I’d prefer maixpy but I can work with SDK/C code.
Is the source code for the directional audio demo available? That would be ideal as I’d really like to just get audio volume and direction info in my code for further processing.


#2

This is probably not going to help you much, but in the schematic of the MAIX GO I see for the MIC array:
MIC_BCK = IO18
MIC_WS = IO19
MIC_DAT3 = IO20
MIC_DAT2 = IO21
MIC_DAT1 = IO22
MIC_DAT0 = IO23
MIC_LED_DAT = IO24
MIC_LED_CLK = IO25

This seems to correspond to the schematic of the mic array.
I also hope that example code becomes available.


#3

microphone array is supported in maixpy beta 0.2.2 (in telegram group file):

from Maix import MIC_ARRAY as mic
import image
import lcd
lcd.init()
mic.init()
while True:
    imga = mic.get_map()
    b = mic.get_dir(imga)
    a = mic.set_led(b,(0,0,255))
    imgb = imga.resize(160,160)
    imgc = imgb.to_rainbow(1)
    a = lcd.display(imgc)
mic.deinit()

#4

That’s great! Thank you.


#5

Nice!

For those interested, an SPI and simple (toggle the pins) implementation for controlling the LEDs (not the microphones) on the mic array can be found here.


#6

And now with microphone access! See ‘mics_and_lights_on_array’ here . It indicates from which direction sound is coming.
The demo is not as nice as the ‘official’ one I have seen, but that was not the point. I had fun finding out how the mic array, I2S, DMA, and other stuff works. Have a look!


#7

well done! congratulations!


#8

Indeed - I was really confused how each mic was being addressed until you pointed out the alternating left/right thing. I guess I need to pay more attention to voltages and grounds in schematics going forward.

BTW is the source for the “ai_demo_dan_micarray_withled” APU example available somewhere? I’ve not been able to locate it anywhere yet.


#9

we integrate it to maixpy now, and will soon push to github


#10

I must admit that I looked up how I2S worked and checked it with print statements. I guess that I need to pay more attention to schematics as well! :slight_smile: