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

**URL:** <https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292>\
**Category:** General\
**Created:** [26 May 2020 05:51 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292 "2020-05-26T05:51:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [26 May 2020 05:51 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/1 "2020-05-26T05:51:29Z")

</div>

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 ...

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [26 May 2020 06:11 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/2 "2020-05-26T06:11:29Z")

</div>

When you installed the drivers according to the seeedstudio wiki [instructions](https://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/) you can use [https://flows.nodered.org/node/node-red-contrib-mic](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

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 10:31 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/3 "2020-05-28T10:31:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 May 2020 11:18 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/4 "2020-05-28T11:18:13Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 11:36 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/5 "2020-05-28T11:36:58Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/3/73d40e2088943a309bcb2709ccaa9a4746d78570.png)  
it like nothing happen..

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 May 2020 11:38 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/6 "2020-05-28T11:38:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 11:41 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/7 "2020-05-28T11:41:02Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/8/0832f162533b79c125454f2cbb12a15b364b4810.png)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 May 2020 11:44 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/8 "2020-05-28T11:44:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 11:50 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/9 "2020-05-28T11:50:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/6/f6e8d9b9e78f070bd19500ae67ed9de9ff6d6f96.png)

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..

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [28 May 2020 12:23 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/10 "2020-05-28T12:23:43Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [28 May 2020 12:53 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/11 "2020-05-28T12:53:03Z")

</div>

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:

```auto
****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:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/d/4d1c7534b83b1554d3ec77e4b8eb763aa888de01.jpeg)  
You can use/import this example flow to test it:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6d7457629a8db9fe434041663893968637cad0cb.jpeg)

```auto
[{"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:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/d/fd14d226f9257a050af13cd695216fec33bfcdcf.jpeg)  
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

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 13:39 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/12 "2020-05-28T13:39:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/eaa5b7ddabd0fb73c69b9196e30bd2ccbad3105c.png)

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

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [28 May 2020 13:42 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/13 "2020-05-28T13:42:03Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 13:46 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/14 "2020-05-28T13:46:10Z")

</div>

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`

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [28 May 2020 13:49 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/15 "2020-05-28T13:49:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 13:50 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/16 "2020-05-28T13:50:37Z")

</div>

i no install anything...

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [28 May 2020 13:53 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/17 "2020-05-28T13:53:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 14:08 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/18 "2020-05-28T14:08:57Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b390c47b01170b2df48c248ad1c889f4358aea1e.png)

---

<div class="post-metadata">

**Author:** ![JGKK](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/jgkk/32/18515_2.png) [@JGKK](https://discourse.nodered.org/u/JGKK)\
**Post date:** [28 May 2020 14:33 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/19 "2020-05-28T14:33:02Z")

</div>

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](https://flows.nodered.org/node/node-red-contrib-wav) in nodered.  
Than import this flow:

```auto
[{"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":[]}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/660b63fcc3f22bc97bee0bf19537b4319a3dfcf9.jpeg)  
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](https://github.com/watson-developer-cloud/node-red-labs/blob/master/basic_examples/speech_to_text/README.md#3-on-a-stand-alone-system) it accepts wav data passed in as a buffer which this is.

---

<div class="post-metadata">

**Author:** ![lingzhongli](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/lingzhongli/32/20078_2.png) [@lingzhongli](https://discourse.nodered.org/u/lingzhongli)\
**Post date:** [28 May 2020 16:43 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/20 "2020-05-28T16:43:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/b/ab9921545776012e0de26f9798d7eb5c583ed575.png)

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

[Next page](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292.md?page=2)
