# Dashboard Audio Out Voice Options

**URL:** <https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919>\
**Category:** Dashboard\
**Created:** [23 August 2020 20:32 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919 "2020-08-23T20:32:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [23 August 2020 20:32 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/1 "2020-08-23T20:32:01Z")

</div>

I have started playing with the Audio Out for Text-To-Speach (TTS) and it is working well but I have run into one item that confuses me. In the dropdown, it shows 20 different voice choices, but some of them if I select them and deploy, it actually switches to a different voice and uses that.

Here is what I see for choices:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/3/f36a8ebc0073492910179db216feaafa63b9fef5.png)

The quickest example is that it will let me select 0, Microsoft David, but if I select 1, Microsoft Zira, it switches to 0, David. It will let me select 2, Google Deustch, or 4, Google UK English Female, but not 3, Google US English .

Thoughts or pointers?

---

<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:** [24 August 2020 07:30 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/2 "2020-08-24T07:30:55Z")

</div>

> [@tmichaeltx](#):
>
> Audio Out for Text-To-Speach (TTS)

I can't immediately find this node. Can you specify which node you are actually using ?

---

<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:** [24 August 2020 18:17 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/3 "2020-08-24T18:17:21Z")

</div>

He is referring to the audio-out node which is shipped with the standard dashboard nodes.  
I think the mechanism works like this:

1. When looking at the [code](https://github.com/node-red/node-red-dashboard/blob/master/nodes/ui_audio.html#L28) of that node's config screen:

2. Then the selected voice will be [send](https://github.com/node-red/node-red-dashboard/blob/master/nodes/ui_audio.js#L23) to the dashboard client:

3. In the dashboard client, all voices have also been [loaded](https://github.com/node-red/node-red-dashboard/blob/master/src/main.js#L380):

4. And finally when the message (from step 2) arrives on the dashboard client, the voice (from step 3) with the same language (as the voice selected on the config screen in step 1) will be used:

So you select a voice in the config screen, from the voices available on the pc where the flow editor is displayed. The selected voice is send to the dashboard and it _ **tries to find the SAME voice** _ on the device where the dashboard is displayed. If that voice is available on both devices then it will be ok. But if the pc where the dashboard is running supports different voices, then you won't get in the dashboard what you have selected in the config screen. Unless I haven't understood it well ...

Might this somehow explain Mike's issue??

Bart

---

<div class="post-metadata">

**Author:** ![tmichaeltx](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@tmichaeltx](https://discourse.nodered.org/u/tmichaeltx)\
**Post date:** [25 August 2020 03:28 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/4 "2020-08-25T03:28:50Z")

</div>

Bart,  
That sounds logical and this mirrors my early thinking on what was happening, but it differs a bit from the experience I am having. When I am editing on a Windows 10 PC, I am provided the list of the 20 voice options. When I pick some voices and deploy, this works. When I pick some of the other voices and deploy and then reopen the node for editing, it is switched to one of the voices in the first category.

This is without actually hearing the voice on a given device displaying the dashboard. I can imagine just as you described if the dashboard is on the same Windows 10 PC it will probably work, but on an iPAD any given voice might work or might not and maybe even it would vary based on Chrome vs Safari on that iPad.

I am just surprised it would give voice options at edit time that it wouldn't actually allow me to save and then deploy.  
-Mike

---

<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:** [25 August 2020 07:38 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/5 "2020-08-25T07:38:32Z")

</div>

> [@tmichaeltx](#):
>
> When I pick some of the other voices and deploy and then reopen the node for editing, it is switched to one of the voices in the first category.

Seems there is a bug in this node...  
I have reproduced your issue, but looks like the internal storage mechanism of the node works correctly:

1. When you open the config screen the first time, the language will be an empty string `""`:

2. But immediately afterwards the change handler (that detects changes in the dropdown list) will set it the voice to `null`

3. When I select "en-US":

4. I press the 'Done' button (deploy is not necessary).

5. When I open the config screen again, the stored "en-US" value is loaded into the dropdown field:

6. And indeed the change handler notices that the stored voice has been selected, since it stores the same value again in the node:

7. But on the screen another language is displayed:

_ **The problem is caused since there are multiple voices with the same language code** _:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/4/44976dbcdd714f8b0344066ada93432dee5c886c.png)

_ **When you open the config screen again, it will show the FIRST language with the selected language code...** _

My time is up for this morning. Hopefully somebody else can join this discussion now.

---

<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:** [25 August 2020 18:44 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/6 "2020-08-25T18:44:14Z")

</div>

This is all the data that is being returned when getting the available voices on the device:

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

IMHO it is not really correct to store the `lang` in the `node.voice` variable, since it refers to multiple voices. Instead I would store the `dataURI`, since that seems to contain unique values.

Perhaps it is useful to store _ **BOTH** _:

- Keep the `lang` in the existing `node.voice` variable
- Store extra the `dataURI` in a new `node.dataURI` variable

Indeed when there is no matching in the client based on the dataURI, we could - as a fallback scenario - match on the `lang`. E.g. when the _"Google UK English Male"_ (selected in the flow editor) is not available in the dashboard, we could fallback to _"Google UK English Female"_ since it has the same language code (_"en-GB"_).

Although I my grandfather always said: "Never listen to a female..." 🤣

Any thoughts about 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:** [26 August 2020 09:19 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/7 "2020-08-26T09:19:22Z")

</div>

> [@BartButenaers](#):
>
> Although I my grandfather always said: "Never listen to a female..." 🤣
> 
> Any thoughts about this??

I suspect your grandmother had other ideas...

---

<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:** [26 August 2020 09:27 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/8 "2020-08-26T09:27:58Z")

</div>

Hi Dave,  
Welcome back!  
I ment whether you had any thoughts about my proposal, not about my grandparents 😂

---

<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:** [26 August 2020 09:43 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/9 "2020-08-26T09:43:07Z")

</div>

well - yes it needs to be fixed by creating some unique but repeatable reference.

---

<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:** [25 September 2020 09:43 UTC](https://discourse.nodered.org/t/dashboard-audio-out-voice-options/31919/10 "2020-09-25T09:43:15Z")

</div>

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