# Stream audio between 2 node red sessions

**URL:** <https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621>\
**Category:** General\
**Created:** [4 September 2021 21:04 UTC](https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621 "2021-09-04T21:04:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bierre2000](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@bierre2000](https://discourse.nodered.org/u/bierre2000)\
**Post date:** [4 September 2021 21:04 UTC](https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621/1 "2021-09-04T21:04:15Z")

</div>

Hi

I have 2 node-red sessions running on 2 different raspberry  
RPI1 has a USB microphone  
RPI2 has speakers

Any suggestion on how to stream sound from RPI1 to RPI2 ?

Cheers  
Pierre

---

<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 September 2021 21:12 UTC](https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621/2 "2021-09-04T21:12:11Z")

</div>

Hello,  
If you want to do it with nodered it is possible with [node-red-contrib-sox-utils](https://flows.nodered.org/node/node-red-contrib-sox-utils) (disclaimer it is one of my nodes).  
But it's probably not the best solution as you will probably not get 100% smooth playback and a little bit of delay.  
Just set a sox microphone node to raw streaming, set up a web socket connection between the two pi's, send the raw stream over the web socket and than connect a sox play node set to raw streaming playback on the web socket out of the other pi.  
If you want smooth low latency playback though I would highly recommend looking at specialized audio solutions outside nodered like snapcast.

Johannes

---

<div class="post-metadata">

**Author:** ![bierre2000](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@bierre2000](https://discourse.nodered.org/u/bierre2000)\
**Post date:** [5 September 2021 06:08 UTC](https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621/3 "2021-09-05T06:08:08Z")

</div>

Hello

Thanks, i'll have a look at sox and snapcast

For the web socket, what node would you use ? I don't know if i have to use the http one, or tcp or udp..  
I guess mqtt is not relevant in this case anyway ?

Pierre

---

<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:** [5 September 2021 14:35 UTC](https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621/4 "2021-09-05T14:35:15Z")

</div>

There is a dedicated websocket node you can use @bierre2000.  
I have used mqtt for similar purposes before but i dont know if it wouldn’t add more latency to the mix.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [4 November 2021 14:35 UTC](https://discourse.nodered.org/t/stream-audio-between-2-node-red-sessions/50621/5 "2021-11-04T14:35:34Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
