# 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:** 2

<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 16:57 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/21 "2020-05-28T16:57:44Z")

</div>

When you connect a file node to the output of the add wav header node and write the the wav buffer to a wav file you can listen to the recording to see if it worked.  
You should configure the file node like this:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/9/f925fa35cb7b404aee11e352459a4383cef4d07b.jpeg)  
Can you try that?  
This way you know if its recording something.

---

<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:** [29 May 2020 02:14 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/22 "2020-05-29T02:14:03Z")

</div>

open the file to see its recording something?

but i uncareful hide the file manager in task bar...how to find it out?

---

<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:** [29 May 2020 04:44 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/23 "2020-05-29T04:44:28Z")

</div>

connect headphones or a speaker to your raspberry pi and open the commandline. Type `aplay /home/pi/yourwav.wav` and listen if you can hear what you recorded.  
Another way would be to use an sftp client like FileZilla to download the file to your laptop and listen to it there to see if it recorded something.

---

<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:** [31 May 2020 14:45 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/24 "2020-05-31T14:45:54Z")

</div>

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

the output show like this...i cant listen what i record

---

<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:** [31 May 2020 14:59 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/25 "2020-05-31T14:59:56Z")

</div>

Where are you plugging your headphones in? It depends what you configured your standard output to be in /etc/asound.conf.  
I think that the driver installation of the 2mic pi hat automatically configures playback over the hat itself. Did you plug your speaker/headphone straight into the hat or the pi?  
The playback itself looks fine.

---

<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:** [31 May 2020 15:27 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/26 "2020-05-31T15:27:35Z")

</div>

Yes, I plug at respeaker 2 mic pi hat

---

<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:** [31 May 2020 16:24 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/27 "2020-05-31T16:24:36Z")

</div>

Have you tried the jack on the pi?

---

<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:** [1 June 2020 02:19 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/28 "2020-06-01T02:19:29Z")

</div>

yes, i try ..also no sound...or it need some coding in terminal for every time i close the pi and respeaker 2 mic?

---

<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:** [3 June 2020 09:02 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/29 "2020-06-03T09:02:21Z")

</div>

Ok please follow along I just set up a fresh pi 3b with a respeaker 2mic hat just for you:  
steps:

update

```auto
sudo apt-get update
sudo apt-get upgrade

```

install git & sox

```auto
sudo apt-get install git sox

```

install seeedvoicecard driver according to their instructions

```auto
git clone https://github.com/respeaker/seeed-voicecard.git
cd seeed-voicecard
sudo ./install.sh
reboot

```

copy/save the generated asound.conf edit the original to new content and save it and reboot

```auto
sudo cp /etc/asound.conf /etc/asound.conf.old
sudo nano /etc/asound.conf

```

change the content to

```auto
pcm.!default {
    type asym
    playback.pcm "speaker"
    capture.pcm "array"
}

pcm.speaker {
    type plug
    slave.pcm "hw:seeed2micvoicec"
}

pcm.array {
    type plug
    slave.pcm "hw:seeed2micvoicec"
}

```

reboot

```auto
sudo shutdown -r now

```

check that seeed didn’t overwrite the config. This can happen, otherwise repeat above

```auto
cat /etc/asound.conf

```

now plug your headphones/speaker into the plug on the seeed card and execute this command

```auto
sox -t alsa default -L -e signed-integer -c 1 -r 16000 -b 16 ~/test.wav trim 0 5 && play ~/test.wav

```

it will record 5 seconds of audio and than play it back to you. You should be able to hear it. I just tested those exact commands and it works.

---

<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:** [4 June 2020 08:45 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/30 "2020-06-04T08:45:19Z")

</div>

so, i am speak to the mic at respeaker right? or i speak to mic at earphone? and i will listen the sound at earphone right?

---

<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:** [4 June 2020 08:55 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/31 "2020-06-04T08:55:24Z")

</div>

What I show above records directly from the two microphones on the respeaker mic and than plays back over the headphone jack on the respeaker mic.

---

<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:** [4 June 2020 13:56 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/32 "2020-06-04T13:56:23Z")

</div>

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

Still cannot...it need run below flow when record?  
[![](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/660b63fcc3f22bc97bee0bf19537b4319a3dfcf9.jpeg) ](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/660b63fcc3f22bc97bee0bf19537b4319a3dfcf9.jpeg)

or just record to respeaker after run below code in terminal?  
`sox -t alsa default -L -e signed-integer -c 1 -r 16000 -b 16 ~/test.wav trim 0 5 && play ~/test.wav`

---

<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:** [4 June 2020 14:17 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/33 "2020-06-04T14:17:58Z")

</div>

are you sure that you have configured the asound.conf correctly?  
Can you show me your asound.conf?

---

<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:** [5 June 2020 01:16 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/34 "2020-06-05T01:16:05Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/4/b49318078ce38884d56ff0a78fc048f6ffbe19ea.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/1/c1ca1ce16bbca59cea46b031b19297d4babcf5fa.png)

---

<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:** [9 June 2020 11:57 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/35 "2020-06-09T11:57:11Z")

</div>

i have try to rewrite asound.conf , but it still show above error...where got wrong?

---

<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:** [12 June 2020 15:23 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/36 "2020-06-12T15:23:26Z")

</div>

Can you install [https://github.com/johanneskropf/node-red-contrib-sox-utils](https://github.com/johanneskropf/node-red-contrib-sox-utils) from github?  
As with this you can select the source you want to record from and also on which device to play the recording. If you install it I can send you an example flow. The good thing is you wont have to change anything in the asound.conf for now if you use that node and you can do everything from nodered.  
This would make testing the mic a lot easier for both of us.

---

<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:** [12 June 2020 15:46 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/38 "2020-06-12T15:46:52Z")

</div>

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

i have installed, is that install successful?

---

<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:** [12 June 2020 15:51 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/39 "2020-06-12T15:51:52Z")

</div>

you need to do the install command from your node-red directory for node-red to find it.  
This is normally  
`~/.node-red`.  
so please do first `cd ~/.node-red ` and than `npm install johanneskropf/node-red-contrib-sox-utils` and than restart node-red with the command `sudo systemctl restart nodered` when you open node-red now you should have the sox record and play node in your palette.

---

<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:** [12 June 2020 16:11 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/40 "2020-06-12T16:11:11Z")

</div>

after install, what should i need do?

---

<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:** [12 June 2020 16:22 UTC](https://discourse.nodered.org/t/what-node-can-using-for-respeaker-2-mic-array-pi-hat-v1-0/27292/41 "2020-06-12T16:22:56Z")

</div>

Did you install sox as per the manual of the node `sudo apt-get install sox` too? If yes than import this flow:

```auto
[{"id":"60716630.cb73b","type":"sox-record","z":"2a8d15bd.b2aeea","name":"","inputSource":"1,0","byteOrder":"-L","encoding":"signed-integer","channels":1,"rate":16000,"bits":16,"gain":"0","lowpass":8000,"showDuration":true,"durationType":"limited","durationLength":"6","silenceDetection":"something","silenceDuration":"1.5","silenceThreshold":"2.5","outputFormat":"wav","debugOutput":true,"x":270,"y":80,"wires":[["7fc73aa2.35d88c"],["cbc56be1.bd447"]]},{"id":"45e5db2c.dfd494","type":"inject","z":"2a8d15bd.b2aeea","name":"","topic":"","payload":"start","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":80,"wires":[["60716630.cb73b"]]},{"id":"7fc73aa2.35d88c","type":"sox-play","z":"2a8d15bd.b2aeea","name":"","outputDevice":"1,0","gain":"0","startNew":"start","debugOutput":true,"x":440,"y":80,"wires":[["ce69ce5f.982028"]]},{"id":"cbc56be1.bd447","type":"debug","z":"2a8d15bd.b2aeea","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":450,"y":140,"wires":[]},{"id":"ce69ce5f.982028","type":"debug","z":"2a8d15bd.b2aeea","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","x":610,"y":80,"wires":[]}]

```

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/8/983f91624825a0bda06f30904dd1c00061a43b75.jpeg)

Than choose the respeaker 2 mic pi hat in both nodes as input/output device and deploy the flow:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/0628b0cf96a0d00bd9146dcbbea9bf131c95d979.jpeg) ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/5/651fe453db8a1284c8831f3342c06afaf36c519f.jpeg)

Plug your headphones into the respeaker hat.  
Than press on the inject node to start the recording and say something. The node is configured to record for a maximum of 6 seconds or until it detects silence. Once it finished recording it will automatically play back that recording to you on the configured output.  
You will see detailed recording and playback information in the debug window.

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

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