# Node red dashboard audio wish

**URL:** <https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798>\
**Category:** Dashboard\
**Created:** [12 November 2018 13:31 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798 "2018-11-12T13:31:04Z")\
**Posts on this page:** 16\
**Page:** 2

<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:** [13 November 2018 23:41 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/21 "2018-11-13T23:41:11Z")

</div>

No, implement as you suggested with msg.reset as that is consistent with other nodes (like delay and trigger etc). I was introducing feature creep which I should not as no-one is asking for it.

---

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [14 November 2018 07:37 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/22 "2018-11-14T07:37:46Z")

</div>

> [@BartButenaers](#):
>
> But for some reason I get no sound at all using TTS, so a bit difficult to test 🥴 Don't know what is wrong, because I have it on all my Raspberry's (so not a result of my dashboard changes)...

Do you have the web interface ( /ui ) open?  
Thats all ways my mistake when testing

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [14 November 2018 08:09 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/23 "2018-11-14T08:09:37Z")

</div>

@RogierQ: Yes I also saw the text arriving in the dashboard (using Chrome debugger) and entering in the 'speak' function, but no sound... But on Android it worked fine, so I could implement the 'reset' and 'oncomplete' features last night also for speech synthesis. Looks to be working identical to normal audio now...

@dceejay: I have only one open issue. When I have N audio nodes on my flow, they all get the same status. However when nodeA plays A.mp3 and nodeB plays B.mp3 (at another time), I only want the status of nodeA to be updated when A.mp3 is playing.

I do it like this:

- In the **ui.js** an event is emitted when the socket gets an audio status change from the browser:

```auto
socket.on('ui-audio', function(audioStatus) {
     ev.emit("audiostatus", audioStatus, socket.client.id, socket.request.connection.remoteAddress);
});

```

- In the **ui\_audio.js** this event is handled by setting the node status:

```auto
var updateStatus = function(audioStatus) {
     ...
     node.status({shape:"dot",fill:"blue",text:audioStatus});
 };
ui.ev.on('audiostatus', updateStatus);

```

Do you know how I can determine in this event handler whether the status update is required for **THIS** audio-out node. If I know that answer, I will try to submit a pull request this evening. Now I'm off ...  
Thanks !!

---

<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:** [14 November 2018 15:58 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/24 "2018-11-14T15:58:38Z")

</div>

Hmm - actually that raises a good point... I wonder if this is the way we want to do it...

Wondering if we need a more general approach for setting status rather than setting specific listeners as that won't be extendable. I think maybe that rather like we have `updateValueEventName` and it's associated handlers - if we need `updateStatusEventName` to do similar for status - in order to allow widgets to update status.

The thinking with things like the ui\_control and ui\_audio node was that as they are across the complete dashboard then you only need one per "project" - the fact that you have two and they both feed data to the same speaker is good fortune. As there is only one physical speaker (or two for stereo 🙂 - then msg.reset will/should stop all the output anyway so the status should reflect that ?

So I think proceed anyway - lets get the PR in and then play with it before release.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [14 November 2018 17:30 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/25 "2018-11-14T17:30:24Z")

</div>

> [@dceejay](#):
>
> there is only one physical speaker

Yes that is the same that I was thinking, since there is only one audio destination... But in my examples with A.mp3 and B.mp3 it is rather confusing when both audio node statusses are updated. But '_in theory_' it is correct behaviour.

Will prepare the PR as soon as possible...  
Thanks!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [14 November 2018 17:33 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/26 "2018-11-14T17:33:43Z")

</div>

> [@dceejay](#):
>
> Wondering if we need a more general approach for setting status

Btw think this would be interesting functionality for the new widget API anyway!

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [14 November 2018 20:25 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/27 "2018-11-14T20:25:34Z")

</div>

Evening guys,

The [pull request](https://github.com/node-red/node-red-dashboard/pull/449) has been submitted.  
Now we have to wait for an approval from the master (of disaster 😉)  
Keep faith and fingers crossed ...

Bart

---

<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:** [14 November 2018 22:54 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/28 "2018-11-14T22:54:40Z")

</div>

Merged to master if you wish to try it.

Thanks Bart - looks fine so far.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [15 November 2018 08:39 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/29 "2018-11-15T08:39:51Z")

</div>

Nice Dave, thanks for the fast support!  
@RogierQ @hugobox: Morning guys, would appreciate if you could test the new dashboard version. You will most probablly use the audio-out node in another way as I do. The TTS support was a good example of this, since I completely had forgotten to implement the new features for TTS also ... Thanks in advance!

---

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [15 November 2018 09:32 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/30 "2018-11-15T09:32:41Z")

</div>

O thats why it is not working with tts  
Did a quick test this morning

---

<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:** [15 November 2018 09:42 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/31 "2018-11-15T09:42:11Z")

</div>

No - the TTS support is in there - as with all dashboard upgrades you need to really flush the browser cache to ensure it loads the latest version. It on master - not npm so

```
cd ~/.node-red
npm i node-red/node-red-dashboard
```

---

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [15 November 2018 10:41 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/32 "2018-11-15T10:41:20Z")

</div>

Cool! Its running!!  
Happy with it!  
Thanks for fixing it so quickly!

---

<div class="post-metadata">

**Author:** ![Alacritous](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Alacritous](https://discourse.nodered.org/u/Alacritous)\
**Post date:** [16 November 2018 04:39 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/33 "2018-11-16T04:39:09Z")

</div>

Why not have multiple outputs for the play action node. one for media start, one for media playing and one for media error and one for media stopped

---

<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:** [16 November 2018 10:10 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/34 "2018-11-16T10:10:45Z")

</div>

I think we have 3 of those. Adding error would make sense.

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [18 November 2018 10:12 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/35 "2018-11-18T10:12:53Z")

</div>

Hey @RogierQ, @hugobox,

In case you haven't noticed already: Dave has [published](https://discourse.nodered.org/t/announce-dashboard-2-11-0/4982) yesterday dashboard version **2.11.0** on NPM, which contains the requested audio-out node features:

- Ability to stop playing audio with `msg.reset=true`
- The node status will display whether the audio is '_ **playing** _', '_ **reset** _', '_ **error** _' or _ **empty** _ when playing has finished normally.

Have fun with it!  
Bart

---

<div class="post-metadata">

**Author:** ![RogierQ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rogierq/32/3211_2.png) [@RogierQ](https://discourse.nodered.org/u/RogierQ)\
**Post date:** [18 November 2018 12:20 UTC](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798/36 "2018-11-18T12:20:51Z")

</div>

Thanks! Got it running 😉

[Previous page](https://discourse.nodered.org/t/node-red-dashboard-audio-wish/4798.md?page=1)
