# Stream from UI microphone over MQTT

**URL:** <https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648>\
**Category:** General\
**Created:** [12 August 2021 09:37 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648 "2021-08-12T09:37:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![patlas](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@patlas](https://discourse.nodered.org/u/patlas)\
**Post date:** [12 August 2021 09:37 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/1 "2021-08-12T09:37:57Z")

</div>

Hi,  
I am wondering if is it possible to edit **node-red-ui-nodes/node-red-node-ui-microphone** to send raw data buffer over mqtt. I would like to set package size (or hardcoded it) and when buffer is full send it over mqtt or just provide it in msg.payload. Current implementation allow only start/stop recording and after that send recorded file, but I want to send chunk of recorded data continuously during recording (like audio stream). Can anyone can confirm if is it possible?

---

<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:** [12 August 2021 19:28 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/2 "2021-08-12T19:28:56Z")

</div>

Why don't you give it a try? you could do it all in one flow.  
First find a node to play the audio. Once you get that working, send the output of the `ui-microphone` to an `mqtt-out` node.  
Add a `mqtt-in` node - subscribing to the topic you published with - and feed that to the node you found to play the audiio.

Let us know how it goes.

---

<div class="post-metadata">

**Author:** ![patlas](https://avatars.discourse-cdn.com/v4/letter/p/85e7bf/32.png) [@patlas](https://discourse.nodered.org/u/patlas)\
**Post date:** [13 August 2021 10:19 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/3 "2021-08-13T10:19:26Z")

</div>

That's not what I mean. I do not know if it is possible from `ui-microphone` point. Current implementation of that node record voice and after stop prepare data ready to process. I am not sure if web browser provide such possibility to stream it. I would like to provide continuously sending chunk of data during "recording" process - in experiment I would like to build some walkie-talkie. But have not enough knowledge to determine if it is possible

---

<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:** [13 August 2021 11:02 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/4 "2021-08-13T11:02:23Z")

</div>

Well unless I try it and see what happens I can’t help you, but you could try it and tell me what results.

I don’t think you are going to get the results you hope for due to the nodes processing the data, network delays and such. But the only way to tell is to try it.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [13 August 2021 17:47 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/5 "2021-08-13T17:47:35Z")

</div>

> [@patlas](#):
>
> I am not sure if web browser provide such possibility to stream it. I would like to provide continuously sending chunk of data during "recording" process - in experiment I would like to build some walkie-talkie. But have not enough knowledge to determine if it is possible

It is feasible to do at the JavaScript level, but the `ui-microphone` node is not implemented to do streaming of audio.

---

<div class="post-metadata">

**Author:** ![sammachin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sammachin/32/5121_2.png) [@sammachin](https://discourse.nodered.org/u/sammachin)\
**Post date:** [17 August 2021 11:45 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/6 "2021-08-17T11:45:56Z")

</div>

@patlas This might do what you need  
Its not using the dashboard but I just put together a flow that allows you to have walkie talkies in a browser with a custom webpage and websockets using Node-RED as the backend. Its based on some code from an old project.  
If someone had the time and inclination then they could possibly turn that webpage into a dashboard node.

[https://flows.nodered.org/flow/15c4cb265eac2826ff46b63b65315e8c](https://flows.nodered.org/flow/15c4cb265eac2826ff46b63b65315e8c)

---

<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:** [16 October 2021 11:46 UTC](https://discourse.nodered.org/t/stream-from-ui-microphone-over-mqtt/49648/7 "2021-10-16T11:46:01Z")

</div>

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