# Dashboard "audio out" node doesn't play audio wav file on mobile phone

**URL:** <https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937>\
**Category:** Dashboard\
**Created:** [3 March 2021 09:54 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937 "2021-03-03T09:54:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [3 March 2021 09:54 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/1 "2021-03-03T09:54:28Z")

</div>

I have created a simple flow using node-red dashboard that plays an audio wav file using the dashboard `audio out` node when clicking on button "beep".

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

```auto
[
    {
        "id": "f6f2187d.f17ca8",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "ee7b07eb.e994d8",
        "type": "ui_audio",
        "z": "f6f2187d.f17ca8",
        "name": "",
        "group": "ce548e2.4cc5f7",
        "voice": "Fiona",
        "always": "",
        "x": 580,
        "y": 80,
        "wires": []
    },
    {
        "id": "24b39a25.16eb76",
        "type": "inject",
        "z": "f6f2187d.f17ca8",
        "name": "say \"hello world\"",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "hello world",
        "payloadType": "str",
        "x": 140,
        "y": 160,
        "wires": [
            [
                "ee7b07eb.e994d8"
            ]
        ]
    },
    {
        "id": "60ee1d6b.e57ef4",
        "type": "ui_button",
        "z": "f6f2187d.f17ca8",
        "name": "",
        "group": "ce548e2.4cc5f7",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "beep",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "icon": "",
        "payload": "",
        "payloadType": "str",
        "topic": "topic",
        "topicType": "msg",
        "x": 130,
        "y": 80,
        "wires": [
            [
                "f45aebd5.111ff8"
            ]
        ]
    },
    {
        "id": "3b866d84.62c7e2",
        "type": "inject",
        "z": "f6f2187d.f17ca8",
        "name": "test_beep",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 20,
        "wires": [
            [
                "f45aebd5.111ff8"
            ]
        ]
    },
    {
        "id": "f45aebd5.111ff8",
        "type": "file in",
        "z": "f6f2187d.f17ca8",
        "name": "",
        "filename": "/data/scan_ok.wav",
        "format": "",
        "chunk": false,
        "sendError": false,
        "encoding": "none",
        "x": 350,
        "y": 80,
        "wires": [
            [
                "ee7b07eb.e994d8"
            ]
        ]
    },
    {
        "id": "ce548e2.4cc5f7",
        "type": "ui_group",
        "name": "Group 1",
        "tab": "d259bcb0.160e3",
        "order": 1,
        "disp": true,
        "width": 6
    },
    {
        "id": "d259bcb0.160e3",
        "type": "ui_tab",
        "name": "Tab 1",
        "icon": "dashboard",
        "order": 1
    }
]

```

This is working when accessing my dashboard in chrome browser on my macbook.

It isn't working when accessing same dashboard in

- safari browser on my macbook
- chrome browser on my iphone.

I guess it has something to do with more strict security settings.  
Is there a way to get it working in chrome browser (or safari browser) on an iphone and android phone ?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 March 2021 10:37 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/2 "2021-03-03T10:37:02Z")

</div>

Mobile browsers hate autoplay - so workarounds are very hard these days. But yes pease if anyone knows how - do shout.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [3 March 2021 14:49 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/3 "2021-03-03T14:49:00Z")

</div>

1/ I did some code digging. So I think the problem is related to the following code in

- [node-red-dashboard/main.js at master · node-red/node-red-dashboard · GitHub](https://github.com/node-red/node-red-dashboard/blob/master/src/main.js)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/5/15f792b9829f3dc1c99e6ada1ceb2bad5bafc592.png)

2/ This code looks very similar to [AudioBuffer example](https://mdn.github.io/webaudio-examples/audio-buffer/) which is described on following page:

- [BaseAudioContext.createBufferSource() - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/BaseAudioContext/createBufferSource)

This example is properly playing noise when I click on "Make white noise" button. I have tested this for following combinations:

- in chrome on macbook
- in safari on macbook
- in chrome on iphone
- in safari on iphone

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 March 2021 17:08 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/4 "2021-03-03T17:08:57Z")

</div>

similar but not the same... the whole point being you are clicking on he button which is your permission to play the sound... the audio node has no button as you just want to push the sound - so no permission = no sound

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [4 March 2021 07:13 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/5 "2021-03-04T07:13:22Z")

</div>

> [@dceejay](#):
>
> the whole point being you are clicking on he button which is your permission to play the sound

1. I understand that but I couldn't find anything on the internet that is explaining this different behaviour for different browsers (e.g. chrome on iphone versus chrome on macbook).

2. Consequently I couldn't find any (browser) settings so I could make audio playing work in chrome on iphone like it does for chrome on macbook.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [4 March 2021 08:01 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/6 "2021-03-04T08:01:07Z")

</div>

Interesting site regarding the autoplay behaviour for different browsers (take care that autoplay is mainly about video but it seems to be applicable as well for audio):

- [2020 state of autoplay for HTML5 video on the web](https://www.radiantmediaplayer.com/blog/2020-state-of-autoplay-for-html5-video-on-the-web.html)

It is a pity that the combination "chrome on IOS" is missing.

The above link makes also reference to following github repository which allows to immediately test your settings by clicking on the [Demo page](https://video-dev.github.io/can-autoplay/)

- [GitHub - video-dev/can-autoplay: The auto-play feature detection in HTMLMediaElement (\<audio\> or \<video\>).](https://github.com/video-dev/can-autoplay)

**The outcome of the demo page for different combinations:**

1. chrome on my iphone (ios):

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

1. safari on my iphone:

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

1. chrome on my macbook:

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

1. safari on my macbook

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/8/78e9fc95d6330e2b1ddb0dbcd6183f412c7e62c2.png)

1. firefox on my macbook:

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

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [4 March 2021 08:14 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/7 "2021-03-04T08:14:12Z")

</div>

It's important to remember that ALL browsers on iOS are just wrappers/skins round Safari's webview component. Apple will not allow full blown other browsers into the app store.

---

<div class="post-metadata">

**Author:** ![janvda](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/janvda/32/234_2.png) [@janvda](https://discourse.nodered.org/u/janvda)\
**Post date:** [10 March 2021 07:25 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/8 "2021-03-10T07:25:09Z")

</div>

It (playing audio) is working now on my iphone.

I can't see what I did to fix this.  
**I have added the site to my iphone Home Screen** and since then it seems to be working but it also works now when I manually reenter the site address in the chrome browser on my iphone.  
It even works when using a different public hostname that is resolving to the same IP addres.

---

<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:** [9 April 2021 07:25 UTC](https://discourse.nodered.org/t/dashboard-audio-out-node-doesnt-play-audio-wav-file-on-mobile-phone/41937/9 "2021-04-09T07:25:48Z")

</div>

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