# Playing mp3 sound from node red to other dashboards

**URL:** <https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816>\
**Category:** General\
**Created:** [4 October 2021 02:28 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816 "2021-10-04T02:28:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [4 October 2021 02:28 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/1 "2021-10-04T02:28:45Z")

</div>

Hello

I have node red running on an Ubuntu server.

I also have a door bell which communicates to node red via MQTT (Ubuntu) and a remote dashboard on an iPad (running safari browser).

When the button is pressed, node-red senses it correctly, but I would like to play an mp3 I have on Ubuntu server on the iPad.

What's the easiest way to do this?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [4 October 2021 06:27 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/2 "2021-10-04T06:27:15Z")

</div>

I may be wrong but browsers don't permit audio without user interaction.

Instead you could use something like an MQTT app that triggers actions on your device. For example [this app](https://www.easymqtt.app/about) says it can trigger Siri shortcuts so in theory could play a sound.

> [@Sirhc](#):
>
> I also have a door bell which communicates to node red via MQTT

Out of interest, is this doorbell a commercial product or home made? Could you share details please?

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [4 October 2021 06:35 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/3 "2021-10-04T06:35:20Z")

</div>

Really? What if I host the mp3 file on a HTTP server, can I then trigger the UI dashboard to play that mp3 file when an event occurs?

Yeah home made, I couldn't find something that suited my purpose. I have a Shelly 1 running on a 12VDC supply then to a simple doorbell button (dry contact). The Shelly 1 detects the doorbell button and sends an MQTT message to node red. I was hoping my iPad could replace the doorbell chime and play a song when someone presses the doorbell.

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [5 October 2021 06:07 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/4 "2021-10-05T06:07:01Z")

</div>

Further to this, I have it working by pulling the mp3 file using a HTTP request node. This works on all PCs running chrome on my network. However I cannot get the file to play in Safari on my iPad.

Does anyone know if there's a setting to enable this in Safari?

Or any other browser for that matter? I really don’t want to install a chime and the iPad is the central control screen for the house.

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [5 October 2021 12:27 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/5 "2021-10-05T12:27:40Z")

</div>

ok some updates, I've managed to play audio files when clicking a button in the dashboard with this script in a template node:

```auto
<script>
$('button').click(function() { new Audio("http://address.com/thismp3.mp3").play();
})
</script>

```

Is there a way to trigger this mp3 with a function node? I want it to play when it receives an MQTT message from the Shelly 1

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [5 October 2021 12:40 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/6 "2021-10-05T12:40:20Z")

</div>

First result on Google searching "safari play sound without click"

> <https://stackoverflow.com/questions/31776548/why-cant-javascript-play-audio-files-on-iphone-safari>

---

<div class="post-metadata">

**Author:** ![Sirhc](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sirhc](https://discourse.nodered.org/u/Sirhc)\
**Post date:** [5 October 2021 12:48 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/7 "2021-10-05T12:48:09Z")

</div>

Thanks for the reply, but this is now beyond me unless someone knows how to integrate this function into node red?

---

<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 December 2021 12:48 UTC](https://discourse.nodered.org/t/playing-mp3-sound-from-node-red-to-other-dashboards/51816/8 "2021-12-04T12:48:47Z")

</div>

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