# Audio on homepage

**URL:** <https://discourse.nodered.org/t/audio-on-homepage/21594>\
**Category:** Dashboard\
**Created:** [12 February 2020 11:54 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594 "2020-02-12T11:54:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [12 February 2020 11:54 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/1 "2020-02-12T11:54:40Z")

</div>

I need to have an audio playing when I open the dashboard homepage. Is it possibile? If yes, in what way? Thank in advance

---

<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 February 2020 11:59 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/2 "2020-02-12T11:59:43Z")

</div>

Hmmmm, first thing I would do is a search ([in the `flows` tab](https://flows.nodered.org/search?type=node)) using 'audio' to see what is avaliable.

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [12 February 2020 12:09 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/3 "2020-02-12T12:09:29Z")

</div>

Thanks for the reply. I try using tts\_google, but it wants a msg.payload on input and I'm not able to pass from my dashboard. I search and I find node-red-contrib-play-audio. Must I use this?

---

<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:** [12 February 2020 13:00 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/4 "2020-02-12T13:00:13Z")

</div>

There is an audio node built into dashboard. You can trigger it from a connect message using the ui-control node. But quite a few browsers now block auto playing audio, so it may not work.

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [12 February 2020 15:12 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/5 "2020-02-12T15:12:15Z")

</div>

Yes, but I would like to play audio every time I open the page without a click

---

<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 February 2020 17:04 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/6 "2020-02-12T17:04:43Z")

</div>

If it is just for you, I beleive you can change the browsers preferences and have it play. If it is for others to use, you may have some people who will not be happy with you (I would be one. If I go to a site that auto plays sound I don't go back)

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [12 February 2020 18:19 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/7 "2020-02-12T18:19:19Z")

</div>

I explain better the problem.  
It's not a public site, but is the homepage of my domotic dashboard.  
I need to play a sound only once e only when I open the dashborad home page.

If I use "Audio Out Node" is ok, but "Audio Out Node" need a msg.payload on input.  
If I "inject" or if I use the output, for example of a "Exec node", is ok and play perfectly my msg.payload.  
But what about pass "msg.payload" from a webpage?  
I've also try this "

;" on a template node, but goes in loop and repeat infinitly the word "Benvenuti" (also if I change the page).

Any suggestions?  
Thank you

---

<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 February 2020 19:45 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/8 "2020-02-12T19:45:15Z")

</div>

try adding a `ui_control` node set to 'Change tab event only' and feed it to the `ui_audio` node

---

<div class="post-metadata">

**Author:** ![mariulin](https://avatars.discourse-cdn.com/v4/letter/m/a9adbd/32.png) [@mariulin](https://discourse.nodered.org/u/mariulin)\
**Post date:** [13 February 2020 21:21 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/9 "2020-02-13T21:21:30Z")

</div>

I've solved in this way:  
"Ui control node" control every tab change event on Dashboard  
"Change node" search for msg.tab 0 (First TAB), replace with a string then move msg.tab to msg.payload.  
The output is passed to "Audio out node" that speak.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/8/b82c2f046c85793b3d3cc60bf6cf94c5810b965d.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10b0b13df59232b22cab13f1dac9bb7acfec3035.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/d/edda04524d8fe8b338da8a41515ef39f6d860293.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/7/77dcfbfd76365837050785543b8eb07c1ff01af5.png)

---

<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:** [14 March 2020 21:35 UTC](https://discourse.nodered.org/t/audio-on-homepage/21594/10 "2020-03-14T21:35:01Z")

</div>

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