What node can using for ReSpeaker 2 Mic Array Pi HAT v1.0

i have install ReSpeaker 2 Mic Array with raspberry Pi 3 (hardware)... how can i use the mic on ReSpeaker 2 Mic Array? need install anythings(software)? and need using what node for receive sound ?

because in my project have a microphone node that will direct use the laptop microphone ...

When you installed the drivers according to the seeedstudio wiki instructions you can use https://flows.nodered.org/node/node-red-contrib-mic same as on your laptop. Just make sure the hw source entered in the nodes config is the one of the respeaker mic.
You can check which card number the respeaker has by running arecord -l from the commandline.
Instead of the mic node you could also use an exec node to run something like a sox record command which would give you more options for things like maximum recording duration and a silence detection which is more finely controllable.

Johannes

how do i know it success or fail? it i speak to it, have will any respond?

Did you try it? Add a catch node connected toe a debug node (set to display Complete msg object) and see what happens.


it like nothing happen..

where is the node-red-contrib-mic node?

Please explain what you think is going on in this flow. I want to hear your thoughts.

above is my project using voice to open door...actually i dont kmow how it work ...i install the respeaker 2 mic on my reapberry... i want the respeaker can receive my sound directly and run this flow...
on above microphone node, it will directly use my laptop microphone... because the raspberry later need install on door so, it want respeaker on respberry can directly the sound...because cannot install the laptop on the door...

so it need to know have any node can receive the sound directly from respeaker and how does i know the respeaker have receive my sound successfully..

It looks like you are in uncharted territory. (Not having that hat I can't experiment)

You might want to see if you can write a python program to listen for sound and then send a message to NR via mqtt.

Good Luck and let us know what you come up with.

Hello I will take you through it step by step first test if you can record from the respeaker mic and its installed correctly.
For this please go to your commandline of the raspberry pi and type arecord -l
You should see an output with a list like this:

**** List of CAPTURE Hardware Devices ****
card 1: ArrayUAC10 [ReSpeaker 4 Mic Array (UAC1.0)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

of course yours should list the 2mic hat and not the array i had connected to the pi where i did this.
If it shows you the 2mic hat in that list than its installed correctly.
If that is the case go into the settings of the mic node and set the device to the card number that was shown in the list next to the entry for the respeaker 2 mic like i did here:


You can use/import this example flow to test it:

[{"id":"d48a88cb.c9158","type":"Mic","z":"20693e98.c7fb2a","name":"","outputPayloadType":"buffer","endian":"little","bitwidth":"16","encoding":"signed-integer","channels":"1","device":"plughw:1,0","rate":"16000","silenceTimeout":"","exitOnSilence":"false","debug":false,"active":true,"x":470,"y":440,"wires":[["b883c6a1.ae1878"]]},{"id":"e1e0484d.f1ea6","type":"inject","z":"20693e98.c7fb2a","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":440,"wires":[["d48a88cb.c9158"]]},{"id":"f297c18c.48c56","type":"inject","z":"20693e98.c7fb2a","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":290,"y":520,"wires":[["d48a88cb.c9158"]]},{"id":"b883c6a1.ae1878","type":"debug","z":"20693e98.c7fb2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":440,"wires":[]}]

When you correctly configured everything and you click start you should see something like this:


Where you can see the raw pcm buffer chunks in your debug tab.
Once you are that far or if you have any problems come back here and i will help you with the rest.
You will have to think of some kind of wakeword detection or another way to start the recording and you will probably have to concat all those buffers to a single buffer object with wav headers at some point and i can help you with all that but please get the streaming of raw audio chunks from the mic into nodered working first.

Johannes

image

it no show anything and it no volume control this devices..

Did you install the custom drivers that seeedstudio supplies for their raspberry pi microphone hats?
https://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/#getting-started
click on this link and follow their instructions to install the necessary drivers in step two.

yes ..i have , but just now i have use sudo raspi-config to do something for audio because want link the bluetooth...before that i have output like you when run arecord -l

What ever you did probably interfered with the driver installation. You could try to uninstall it using the uninstall script they supply and than install them again.

i no install anything...

Something you did did. I have used quite a few of those respeaker mics in the last few years and I hadn’t had anything like this happen. I would try uninstalling and reinstalling those drivers again. Make a backup before of anything critical of course.

okey, the problem is solved ...
then now i want link to speech to text node, but it show error...

Yes because the watson stt node expects a single wav buffer object but straight from the mic node you get raw pcm audio chunks as a stream of buffers. So you need to join the buffers and add wav headers to it. You will need to install https://flows.nodered.org/node/node-red-contrib-wav in nodered.
Than import this flow:

[{"id":"c4303dc0.528f58","type":"Mic","z":"20693e98.c7fb2a","name":"","outputPayloadType":"buffer","endian":"little","bitwidth":"16","encoding":"signed-integer","channels":"1","device":"plughw:1,0","rate":"16000","silenceTimeout":"","exitOnSilence":"false","debug":"false","active":true,"x":350,"y":100,"wires":[["e57e38ee.a8f43","d850d294.9c4298"]]},{"id":"78a41c6d.53ef14","type":"inject","z":"20693e98.c7fb2a","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":100,"wires":[["c4303dc0.528f58"]]},{"id":"1948e4b1.02c3ab","type":"inject","z":"20693e98.c7fb2a","name":"","topic":"","payload":"stop","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":160,"wires":[["c4303dc0.528f58"]]},{"id":"6184fc9.0b92e84","type":"join","z":"20693e98.c7fb2a","name":"","mode":"custom","build":"buffer","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":810,"y":100,"wires":[["97a658a2.a84b2"]]},{"id":"e57e38ee.a8f43","type":"switch","z":"20693e98.c7fb2a","name":"data?","property":"event","propertyType":"msg","rules":[{"t":"eq","v":"data","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":100,"wires":[["6184fc9.0b92e84"]]},{"id":"d850d294.9c4298","type":"switch","z":"20693e98.c7fb2a","name":"end?","property":"event","propertyType":"msg","rules":[{"t":"eq","v":"end","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":160,"wires":[["50230b1c.19d63c"]]},{"id":"50230b1c.19d63c","type":"change","z":"20693e98.c7fb2a","name":"complete","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"complete","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":160,"wires":[["45162dad.2ec70c"]]},{"id":"45162dad.2ec70c","type":"delay","z":"20693e98.c7fb2a","name":"","pauseType":"delay","timeout":"100","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":810,"y":160,"wires":[["6184fc9.0b92e84"]]},{"id":"97a658a2.a84b2","type":"wav-headers","z":"20693e98.c7fb2a","name":"","action":"add","channels":1,"samplerate":"16000","bitwidth":16,"x":990,"y":100,"wires":[["5a15fd13.012ffc"],[]]},{"id":"5a15fd13.012ffc","type":"debug","z":"20693e98.c7fb2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1190,"y":100,"wires":[]}]


This will give you a single wav buffer once you stop recording. You should be able to feed this straight into the watson stt node as according to this example it accepts wav data passed in as a buffer which this is.

but it no text at output...like respeaker no receive my sound...