node-red-contrib-tts-ultimate 3.0.4 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,12 +1,11 @@
1
-
2
- ![Sample Node](img/logo.png)
1
+ ![Sample Node](img/logo.png)
3
2
 
4
3
  [![NPM version][npm-version-image]][npm-url]
5
4
  [![NPM downloads per month][npm-downloads-month-image]][npm-url]
6
5
  [![NPM downloads total][npm-downloads-total-image]][npm-url]
7
6
  [![MIT License][license-image]][license-url]
8
7
  [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
9
- [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
8
+ [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
10
9
  [![Facebook][facebook-image]][facebook-url]
11
10
 
12
11
  <img src='https://raw.githubusercontent.com/Supergiovane/node-red-contrib-tts-ultimate/master/img/main.png' width="80%">
@@ -16,114 +15,251 @@
16
15
  > Adjust the nodes according to your setup
17
16
 
18
17
  ```js
19
- [{"id":"569773ae.930abc","type":"inject","z":"344c547c.b230c4","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":300,"wires":[["e066ce90.46f758"]]},{"id":"e066ce90.46f758","type":"function","z":"344c547c.b230c4","name":"Via function","func":"// The simplest way\nmsg.payload=\"Benvenuti,Wilkommen,Wellcome!\";\nreturn msg;\n","outputs":1,"noerr":0,"x":370,"y":300,"wires":[["3d9635bc.53c14a"]]},{"id":"c272b47c.41e238","type":"inject","z":"344c547c.b230c4","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":340,"wires":[["2fcffdb7.1c76ea"]]},{"id":"2fcffdb7.1c76ea","type":"function","z":"344c547c.b230c4","name":"Set volume","func":"// Set the Volume\nmsg.volume=\"60\"; // If not set, will take the volume from setting page\nmsg.payload=\"Benvenuti,Wilkommen,Wellcome!\";\nreturn msg;\n\n","outputs":1,"noerr":0,"x":370,"y":340,"wires":[["3d9635bc.53c14a"]]},{"id":"2bd6fd7f.9b9ae2","type":"inject","z":"344c547c.b230c4","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":380,"wires":[["aa3b6e42.669fc"]]},{"id":"aa3b6e42.669fc","type":"function","z":"344c547c.b230c4","name":"Array of messages","func":"// Create an array of messages\nvar aMessages=[];\n// Add random messages\naMessages.push({volume:\"50\",payload:\"Benvenuti.\"});\n// Wheater in Italy\naMessages.push({volume:\"40\",payload:\"http://media.ilmeteo.it/audio/2020-12-23.mp3\"});\n// Add random messages\naMessages.push({volume:\"30\",payload:\"Cambia la tua voce nei settaggi.\"});\nreturn [aMessages];\n","outputs":1,"noerr":0,"x":390,"y":380,"wires":[["3d9635bc.53c14a"]]},{"id":"3e0d9b5c.fe01b4","type":"inject","z":"344c547c.b230c4","name":"Hello World","topic":"","payload":"Ciao Mondo! Come stai?","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":260,"wires":[["3d9635bc.53c14a"]]},{"id":"42e6fab4.e8d154","type":"comment","z":"344c547c.b230c4","name":"Play text on Sonos. Single player or Group of players","info":"","x":360,"y":220,"wires":[]},{"id":"3d9635bc.53c14a","type":"ttsultimate","z":"344c547c.b230c4","name":"","voice":"Brian","ssml":false,"sonosipaddress":"192.168.1.109","sonosvolume":"30","sonoshailing":"Hailing_Hailing.mp3","config":"557d8082.eb5a8","property":"payload","propertyType":{},"rules":[],"x":610,"y":260,"wires":[[]]},{"id":"557d8082.eb5a8","type":"ttsultimate-config","z":"","name":"googletranslate","noderedipaddress":"192.168.1.219","noderedport":"1980","purgediratrestart":"leave","ttsservice":"googletranslate"}]
18
+ [
19
+ {
20
+ id: "569773ae.930abc",
21
+ type: "inject",
22
+ z: "344c547c.b230c4",
23
+ name: "",
24
+ topic: "",
25
+ payload: "true",
26
+ payloadType: "bool",
27
+ repeat: "",
28
+ crontab: "",
29
+ once: false,
30
+ onceDelay: 0.1,
31
+ x: 230,
32
+ y: 300,
33
+ wires: [["e066ce90.46f758"]],
34
+ },
35
+ {
36
+ id: "e066ce90.46f758",
37
+ type: "function",
38
+ z: "344c547c.b230c4",
39
+ name: "Via function",
40
+ func: '// The simplest way\nmsg.payload="Benvenuti,Wilkommen,Wellcome!";\nreturn msg;\n',
41
+ outputs: 1,
42
+ noerr: 0,
43
+ x: 370,
44
+ y: 300,
45
+ wires: [["3d9635bc.53c14a"]],
46
+ },
47
+ {
48
+ id: "c272b47c.41e238",
49
+ type: "inject",
50
+ z: "344c547c.b230c4",
51
+ name: "",
52
+ topic: "",
53
+ payload: "true",
54
+ payloadType: "bool",
55
+ repeat: "",
56
+ crontab: "",
57
+ once: false,
58
+ onceDelay: 0.1,
59
+ x: 230,
60
+ y: 340,
61
+ wires: [["2fcffdb7.1c76ea"]],
62
+ },
63
+ {
64
+ id: "2fcffdb7.1c76ea",
65
+ type: "function",
66
+ z: "344c547c.b230c4",
67
+ name: "Set volume",
68
+ func: '// Set the Volume\nmsg.volume="60"; // If not set, will take the volume from setting page\nmsg.payload="Benvenuti,Wilkommen,Wellcome!";\nreturn msg;\n\n',
69
+ outputs: 1,
70
+ noerr: 0,
71
+ x: 370,
72
+ y: 340,
73
+ wires: [["3d9635bc.53c14a"]],
74
+ },
75
+ {
76
+ id: "2bd6fd7f.9b9ae2",
77
+ type: "inject",
78
+ z: "344c547c.b230c4",
79
+ name: "",
80
+ topic: "",
81
+ payload: "true",
82
+ payloadType: "bool",
83
+ repeat: "",
84
+ crontab: "",
85
+ once: false,
86
+ onceDelay: 0.1,
87
+ x: 230,
88
+ y: 380,
89
+ wires: [["aa3b6e42.669fc"]],
90
+ },
91
+ {
92
+ id: "aa3b6e42.669fc",
93
+ type: "function",
94
+ z: "344c547c.b230c4",
95
+ name: "Array of messages",
96
+ func: '// Create an array of messages\nvar aMessages=[];\n// Add random messages\naMessages.push({volume:"50",payload:"Benvenuti."});\n// Wheater in Italy\naMessages.push({volume:"40",payload:"http://media.ilmeteo.it/audio/2020-12-23.mp3"});\n// Add random messages\naMessages.push({volume:"30",payload:"Cambia la tua voce nei settaggi."});\nreturn [aMessages];\n',
97
+ outputs: 1,
98
+ noerr: 0,
99
+ x: 390,
100
+ y: 380,
101
+ wires: [["3d9635bc.53c14a"]],
102
+ },
103
+ {
104
+ id: "3e0d9b5c.fe01b4",
105
+ type: "inject",
106
+ z: "344c547c.b230c4",
107
+ name: "Hello World",
108
+ topic: "",
109
+ payload: "Ciao Mondo! Come stai?",
110
+ payloadType: "str",
111
+ repeat: "",
112
+ crontab: "",
113
+ once: false,
114
+ onceDelay: 0.1,
115
+ x: 250,
116
+ y: 260,
117
+ wires: [["3d9635bc.53c14a"]],
118
+ },
119
+ {
120
+ id: "42e6fab4.e8d154",
121
+ type: "comment",
122
+ z: "344c547c.b230c4",
123
+ name: "Play text on Sonos. Single player or Group of players",
124
+ info: "",
125
+ x: 360,
126
+ y: 220,
127
+ wires: [],
128
+ },
129
+ {
130
+ id: "3d9635bc.53c14a",
131
+ type: "ttsultimate",
132
+ z: "344c547c.b230c4",
133
+ name: "",
134
+ voice: "Brian",
135
+ ssml: false,
136
+ sonosipaddress: "192.168.1.109",
137
+ sonosvolume: "30",
138
+ sonoshailing: "Hailing_Hailing.mp3",
139
+ config: "557d8082.eb5a8",
140
+ property: "payload",
141
+ propertyType: {},
142
+ rules: [],
143
+ x: 610,
144
+ y: 260,
145
+ wires: [[]],
146
+ },
147
+ {
148
+ id: "557d8082.eb5a8",
149
+ type: "ttsultimate-config",
150
+ z: "",
151
+ name: "googletranslate",
152
+ noderedipaddress: "192.168.1.219",
153
+ noderedport: "1980",
154
+ purgediratrestart: "leave",
155
+ ttsservice: "googletranslate",
156
+ },
157
+ ];
20
158
  ```
21
- </details>
22
159
 
160
+ </details>
23
161
 
24
162
  ## DESCRIPTION
163
+
25
164
  This node transforms a text into a speech audio that you can hear natively via <b>SONOS</b> speakers, but you can also simply create an audio file, without using SONOS at all.<br/>
26
165
  You can also generate an audio file for bluetooth speakers, web pages, etc.<br/>
27
166
  You can also use it with **your own audio file** as well and it can be used **totally offline** even without the use of TTS, without internet connection.<br/>
28
- The node can also create a ***TTS file (without the use of any Sonos device)***, to be read by third parties nodes.<br/>
29
- This is a major ***upgrade from the previously popular node SonosPollyTTS*** (SonosPollyTTS is not developed anymore).<br/>
167
+ The node can also create a **_TTS file (without the use of any Sonos device)_**, to be read by third parties nodes.<br/>
168
+ This is a major **_upgrade from the previously popular node SonosPollyTTS_** (SonosPollyTTS is not developed anymore).<br/>
30
169
 
170
+ ## SUPPORTED TTS ENGINES
171
+
172
+ <p>
173
+ <a href="https://www.npmjs.com/package/google-translate-tts" title="Google Translate TTS (free)">
174
+ <img src="https://cdn.simpleicons.org/googletranslate/4285F4" height="126" alt="Google Translate logo"/>
175
+ </a>&nbsp;&nbsp;
176
+ <a href="https://cloud.google.com/text-to-speech" title="Google Cloud Text-to-Speech">
177
+ <img src="https://cdn.simpleicons.org/googlecloud/4285F4" height="126" alt="Google Cloud logo"/>
178
+ </a>&nbsp;&nbsp;
179
+ <a href="https://elevenlabs.io" title="ElevenLabs">
180
+ <img src="https://cdn.simpleicons.org/elevenlabs/000000" height="126" alt="ElevenLabs logo"/>
181
+ </a>&nbsp;&nbsp;
182
+ <a href="https://voice.ai/docs/api-reference/text-to-speech/generate-speech" title="Voice.ai">
183
+ <img src="https://voice.ai/favicon.ico" height="126" alt="Voice.ai logo"/>
184
+ </a>
185
+ </p>
31
186
 
32
187
  [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
33
188
 
34
189
  ## CHANGELOG
35
- * See <a href="https://github.com/Supergiovane/node-red-contrib-tts-ultimate/blob/master/CHANGELOG.md">here the changelog</a>
190
+
191
+ - See <a href="https://github.com/Supergiovane/node-red-contrib-tts-ultimate/blob/master/CHANGELOG.md">here the changelog</a>
36
192
 
37
193
  ## FEATURES
38
- * **Native Sonos support**: hear the TTS audio directly via Sonos. You can also group speakers, set an hailing sound, choose the volume of each speaker etc.
39
- * **Output audio file**: the node can just create the TTS file to be used by other nodes. In this case, you doesn't need to use Sonos as player.
40
- * **Gooogle Translate Voices, Google TTS Voices and Elevenlabs.io voices** are all supported, with all avaiables languages and genders.
41
- * **Automatic grouping** is supported. You can group all players you want to play your announcements.
42
- * **Automatic discovery** of your players.
43
- * **Automatic resume of music** queue (including radio stations, but here, some users reports problem resuming ***radio stations*** and, because of lack of Sonos API documentation, the issue cannot currently be fixed), at exact track, at exact time. **Be aware that this could not work with all music queues**.
44
- * **TTS caching**. Elevenlabs and Google paid service, charges you if you use they tts service for a high rate of text to speech requests. TTS-Ultimate caches the TTS files. It downloads the TTS audio from Amazon or Google only once. The second time, the node will read it from the cache. The caches is resilient, that means it survives reboots and updates.
45
- * **Can work offline**. You can use your own audio files (with OwnFile node) to make the node works offline.
46
- * **UPLOAD your own audio files**. You can also upload your own audio files with OwnFile node.
47
194
 
195
+ - **Native Sonos support**: hear the TTS audio directly via Sonos. You can also group speakers, set an hailing sound, choose the volume of each speaker etc.
196
+ - **Output audio file**: the node can just create the TTS file to be used by other nodes. In this case, you doesn't need to use Sonos as player.
197
+ - **Google Translate Voices, Google TTS Voices, ElevenLabs voices and Voice.ai voices** are supported.
198
+ - **Automatic grouping** is supported. You can group all players you want to play your announcements.
199
+ - **Automatic discovery** of your players.
200
+ - **Automatic resume of music** queue (including radio stations, but here, some users reports problem resuming **_radio stations_** and, because of lack of Sonos API documentation, the issue cannot currently be fixed), at exact track, at exact time. **Be aware that this could not work with all music queues**.
201
+ - **TTS caching**. ElevenLabs and Google paid service charge you for a high rate of text-to-speech requests. TTS-Ultimate caches the TTS files: it downloads each generated audio only once, and then reads it from cache. The cache is resilient (survives reboots and updates).
202
+ - **Can work offline**. You can use your own audio files (with OwnFile node) to make the node works offline.
203
+ - **UPLOAD your own audio files**. You can also upload your own audio files with OwnFile node.
48
204
 
49
- ## BREAKING CHANGE ! BREAKING CHANGE ! BREAKING CHANGE ! BREAKING CHANGE !
205
+ ## BREAKING CHANGE !
50
206
 
51
207
  <p>
52
208
  <b>Version 3.0.0</b> April 2025<br/>
53
209
  - BREAKING CHANGE: Amazon Polly and Microsoft Azure TTS have been removed due to lack of time to update the old and complex API's. Anyone can add these again by forking the project and do a PR. Thank you!. If you still need those TTS, please stay or revert to 2.0.10.<br/>
54
210
  </p>
55
211
 
56
- -----------------------------------------------------------------------
212
+ ---
57
213
 
58
214
  <br/>
59
215
 
60
- >
61
- > ***NOTE IF YOU CANNOT UPLOAD YOUR OWN FILES***
216
+ > **_NOTE IF YOU CANNOT UPLOAD YOUR OWN FILES_**
62
217
  >
63
218
  > If you're running node-red as "plugin" for homeassistant, redmatic etc...<br/>
64
219
  > You may expect not to be able to upload your own files. Please check that the user running node-red, has premission **to write to the filesystem**.<br/>
65
- >
66
220
 
67
221
  <br/><br/>
68
222
 
69
223
  # TTS Service node
70
- Here you can set all parameters you need. All nodes will refer to this config node, so you need to set it only once.<br/>
224
+
225
+ Here you can set all parameters you need. All nodes will refer to this config node, so you need to set it only once.<br/>
71
226
  IF YOU RUN NODE-RED BEHIND DOCKER OR SOMETHING ELSE, BE AWARE: <br/>
72
227
  PORT USED BY THE NODE ARE 1980 (DEFAULT) AND 1400 (FOR SONOS DISCOVER). <br/>
73
228
  PLEASE ALLOW MDNS AND UDP AS WELL
74
229
 
75
230
  **TTS Service**<br/>
76
- You can choose between Elevenlabs.io, Google (without credentials), Google TTS (require credentials and registration to google).<br/>
231
+ You can choose between Voice.ai, Elevenlabs.io, Google (without credentials), Google TTS (require credentials and registration to google).<br/>
77
232
  For Google TTS Engine, you can choose pitch and speed rate of the voice.
78
233
  <br/>
79
234
  <br/>
80
235
 
81
- * **TTS Service using Amazon AWS (Polly)**<br/>
82
-
83
- (REMOVED IN v3.0.0 AND NOT USED ANYMORE)
84
-
85
- !IF YOU NEED THIS SERVICE, INSTALL ANY VERSION < 3.0.0 (ANY 2.x.x IS FINE)!
86
- > ``` npm install node-red-contrib-tts-ultimate@2.0.10 ```
87
-
88
- [Navigate here go here to view the old version](https://www.npmjs.com/package/node-red-contrib-tts-ultimate/v/2.0.10)
89
-
90
- <br/>
236
+ - **TTS Service using Google (without credentials)**<br/>
237
+ This is the simplest way. Just select the voice and you're done. You don't need any credential and you don't even need to be registered to any google service. The voice list is more limited than other services, but it works without hassles.
238
+ Note: long texts are automatically split into 200-character chunks (Google Translate TTS limit) and merged into a single audio output.
239
+ Manual verify: `npm run verify:googletranslate-split -- --voice it-IT --text "..." --out ./out.mp3`
91
240
 
92
- * **TTS Service using Google (without credentials)**<br/>
93
- This is the simplest way. Just select the voice and you're done. You don't need any credential and you don't even need to be registered to any google service. The voice list is more limited than other services, but it works without hassles.
94
- Note: long texts are automatically split into 200-character chunks (Google Translate TTS limit) and merged into a single audio output.
95
- Manual verify: `npm run verify:googletranslate-split -- --voice it-IT --text "..." --out ./out.mp3`
96
-
97
241
  <br/>
98
242
 
99
- * **TTS Service using Google TTS**<br/>
100
- For Google TTS Engine, you can choose pitch and speed rate of the voice.<br/>
101
- **Google credentials file path**<br/>
102
- Here you must select your credential file, previously downloaded from Google, [with these steps](https://www.npmjs.com/package/@google-cloud/text-to-speech):
103
- > [Select or create a Cloud Platform project](https://console.cloud.google.com/project)<br/>
104
- > [Enable billing for your project](https://support.google.com/cloud/answer/6293499#enable-billing)<br/>
105
- > [Enable the Google Cloud Text-to-Speech API](https://console.cloud.google.com/flows/enableapi?apiid=texttospeech.googleapis.com)<br/>
106
-
243
+ - **TTS Service using Google TTS**<br/>
244
+ For Google TTS Engine, you can choose pitch and speed rate of the voice.<br/>
245
+ **Google credentials file path**<br/>
246
+ Here you must select your credential file, previously downloaded from Google, [with these steps](https://www.npmjs.com/package/@google-cloud/text-to-speech):
247
+ > [Select or create a Cloud Platform project](https://console.cloud.google.com/project)<br/>
248
+ > [Enable billing for your project](https://support.google.com/cloud/answer/6293499#enable-billing)<br/>
249
+ > [Enable the Google Cloud Text-to-Speech API](https://console.cloud.google.com/flows/enableapi?apiid=texttospeech.googleapis.com)<br/>
107
250
 
108
251
  <br/>
109
252
 
110
- * **TTS Service using Microsot Azure TTS**
111
-
112
- (REMOVED IN v3.0.0 AND NOT USED ANYMORE)
253
+ - **TTS Service using ElevenLabs**<br/>
254
+ Please use the V2 engine, as the V1 is deprecated and will not longer be supported. The V2 has multilingual voices and is more powerful.
255
+ You have two choiches: To register to eventlabs, or not to register. If you don't register to elevenlabs.io, you will either have access on a limited amount of voices, or no access at all.
256
+ After registration at elevenlabs.io, you can add any language to your personal list. The personal list will be then show in the node voice's list.<br/>
257
+ <br/>
113
258
 
114
- !IF YOU NEED THIS SERVICE, INSTALL ANY VERSION < 3.0.0 (ANY 2.x.x IS FINE)!
115
- > ``` npm install node-red-contrib-tts-ultimate@2.0.10 ```
116
-
117
- [Navigate here go here to view the old version](https://www.npmjs.com/package/node-red-contrib-tts-ultimate/v/2.0.10)
118
-
119
-
120
- <br/>
121
-
122
- * **TTS Service using ElevenLabs**<br/>
123
- Please use the V2 engine, as the V1 is deprecated and will not longer be supported. The V2 has multilingual voices and is more powerful.
124
- You have two choiches: To register to eventlabs, or not to register. If you don't register to elevenlabs.io, you will either have access on a limited amount of voices, or no access at all.
125
- After registration at elevenlabs.io, you can add any language to your personal list. The personal list will be then show in the node voice's list.<br/>
126
- <br/>
259
+ - **TTS Service using Voice.ai**<br/>
260
+ Add your Voice.ai API key in the config node, deploy and restart Node-RED. The node will load your available voices and show them in the Voice dropdown.
261
+ Note: SSML is not supported by this engine.
262
+ <br/>
127
263
 
128
264
  **Node-Red IP**<br/>
129
265
  set IP of your node-red machine. Write **AUTODISCOVER** to allow the node to auto discover your IP.
@@ -135,26 +271,26 @@ Note: if you use multiple `ttsultimate-config` nodes, each one now keeps its own
135
271
 
136
272
  **TTS Cache**
137
273
  <br/>
138
- ***Purge and delete the TTS cache folder at deploy or restart***<br/>
274
+ **_Purge and delete the TTS cache folder at deploy or restart_**<br/>
139
275
  On each deploy or node-red restart, delete all tts files in the cache. This is useful not to run out of disk space, in case you've a lot of TTS speech files.
140
276
  <br/>
141
- ***Leave the TTS cache folder untouched*** (suggested only if you have enough disk space)<br/>
277
+ **_Leave the TTS cache folder untouched_** (suggested only if you have enough disk space)<br/>
142
278
  Don't delete the files cached. Useful if you wish to keep the tts files, even in case of internet outages, node-red restart or reboots.
143
- <br/>
279
+ <br/>
144
280
 
145
281
  **Cache root folder**
146
282
  <br/>
147
283
  Set your preferred output folder for the files downloaded by the TTS Engine.<br/>
148
284
  This is useful if you wish to save the TTS cached files in a folder accessible, for example, by a third party web servers to serve an AirPlay2 speaker.<br/>
149
285
  Leave this field blank for the default.<br/>
150
- <br/>
286
+ <br/>
151
287
  <br/>
152
288
 
153
289
  # TTS-ULTIMATE NODE
154
290
 
155
291
  ## INPUT MESSAGES TO THE NODE <br/>
156
292
 
157
- *Examples*
293
+ _Examples_
158
294
 
159
295
  ```js
160
296
  // Play a message
@@ -172,14 +308,15 @@ return msg;
172
308
  ```js
173
309
  // Play a message with custom voice ID
174
310
  msg.payload = "Hello, the current temperature is 12°";
175
- msg.voiceId = 2
311
+ msg.voiceId = 2;
176
312
  return msg;
177
313
  ```
178
314
 
179
315
  ```js
180
316
  // Play smoke detection
181
317
  msg.sonoshailing = "SmokeAlert";
182
- msg.payload = "Warning, smoke detected. Fire extinguishers are in the kitchen, hall and garage.";
318
+ msg.payload =
319
+ "Warning, smoke detected. Fire extinguishers are in the kitchen, hall and garage.";
183
320
  return msg;
184
321
  ```
185
322
 
@@ -205,17 +342,16 @@ return msg;
205
342
 
206
343
  ## CHANGE CONFIGURATION VIA MSG PROPERTY
207
344
 
208
- You can change the configuration of tts-ultimate, *via msg.setConfig* property.<br/>
209
- The property is a JSON object.
345
+ You can change the configuration of tts-ultimate, _via msg.setConfig_ property.<br/>
346
+ The property is a JSON object.
210
347
 
211
348
  <img src='https://github.com/Supergiovane/node-red-contrib-tts-ultimate/raw/master/img/setConfig.png' width="80%">
212
349
 
213
-
214
350
  ```js
215
351
  // Set main player IP
216
352
  // The setting is retained until the node receives another msg.setConfig or until node-red is restarted.
217
- var config= {
218
- setMainPlayerIP:"192.168.1.109"
353
+ var config = {
354
+ setMainPlayerIP: "192.168.1.109",
219
355
  };
220
356
  msg.setConfig = config;
221
357
  return msg;
@@ -225,13 +361,13 @@ return msg;
225
361
  // Set player IP and additional players with their optional adapted volume, relative to the main sonos player volume.
226
362
  // You can specify the aditional player's volume adaptation
227
363
  // The setting is retained until the node receives another msg.setConfig or until node-red is restarted.
228
- var config= {
229
- setMainPlayerIP:"192.168.1.109",
230
- setPlayerGroupArray:[
231
- "192.168.1.110", // This additional player will use the same volume as the main sonos player.
232
- "192.168.1.111#-10", // This additional player will use the main sonos player's volume, minus 10.
233
- "192.168.1.112#20" // This additional player will use the main sonos player's volume, plus 20.
234
- ]
364
+ var config = {
365
+ setMainPlayerIP: "192.168.1.109",
366
+ setPlayerGroupArray: [
367
+ "192.168.1.110", // This additional player will use the same volume as the main sonos player.
368
+ "192.168.1.111#-10", // This additional player will use the main sonos player's volume, minus 10.
369
+ "192.168.1.112#20", // This additional player will use the main sonos player's volume, plus 20.
370
+ ],
235
371
  };
236
372
  msg.setConfig = config;
237
373
  return msg;
@@ -240,9 +376,9 @@ return msg;
240
376
  ```js
241
377
  // If you have only one additional player, without setting their adjusted volume.
242
378
  // The setting is retained until the node receives another msg.setConfig or until node-red is restarted.
243
- var config= {
244
- setMainPlayerIP:"192.168.1.109",
245
- setPlayerGroupArray:["192.168.1.110"]
379
+ var config = {
380
+ setMainPlayerIP: "192.168.1.109",
381
+ setPlayerGroupArray: ["192.168.1.110"],
246
382
  };
247
383
  msg.setConfig = config;
248
384
  return msg;
@@ -255,8 +391,112 @@ return msg;
255
391
  > Adjust the nodes according to your setup
256
392
 
257
393
  ```js
258
- [{"id":"4b4514d.047366c","type":"ttsultimate","z":"235d8e3d.a7583a","name":"","voice":"de-DE","ssml":false,"sonosipaddress":"192.168.1.109","sonosvolume":"5","sonoshailing":"0","config":"feee307e.54bca","property":"payload","propertyType":{},"rules":[],"x":430,"y":360,"wires":[["2b2d7556.251d0a"],["2978fe86.e680aa"]]},{"id":"2b2d7556.251d0a","type":"debug","z":"235d8e3d.a7583a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":340,"wires":[]},{"id":"2978fe86.e680aa","type":"debug","z":"235d8e3d.a7583a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":610,"y":380,"wires":[]},{"id":"9d9e06be.09718","type":"function","z":"235d8e3d.a7583a","name":"Change Config","func":"// Set the main player IP and each IP belonging to the player's group\nvar config= {\n setMainPlayerIP:\"192.168.1.109\",\n setPlayerGroupArray:[\n \"192.168.1.110\",\n \"192.168.1.111\",\n \"192.168.1.112\"\n ]\n};\nmsg.setConfig = config;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":260,"y":360,"wires":[["4b4514d.047366c"]]},{"id":"c3da8b3a.e8f2c8","type":"inject","z":"235d8e3d.a7583a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"Hello","payloadType":"str","x":110,"y":360,"wires":[["9d9e06be.09718"]]},{"id":"c55b7140.4a7cc8","type":"comment","z":"235d8e3d.a7583a","name":"Change the player and/or group of players via msg property.","info":"","x":270,"y":300,"wires":[]},{"id":"feee307e.54bca","type":"ttsultimate-config","name":"Config","noderedipaddress":"192.168.1.161","noderedport":"1980","purgediratrestart":"leave","ttsservice":"googletranslate"}]
394
+ [
395
+ {
396
+ id: "4b4514d.047366c",
397
+ type: "ttsultimate",
398
+ z: "235d8e3d.a7583a",
399
+ name: "",
400
+ voice: "de-DE",
401
+ ssml: false,
402
+ sonosipaddress: "192.168.1.109",
403
+ sonosvolume: "5",
404
+ sonoshailing: "0",
405
+ config: "feee307e.54bca",
406
+ property: "payload",
407
+ propertyType: {},
408
+ rules: [],
409
+ x: 430,
410
+ y: 360,
411
+ wires: [["2b2d7556.251d0a"], ["2978fe86.e680aa"]],
412
+ },
413
+ {
414
+ id: "2b2d7556.251d0a",
415
+ type: "debug",
416
+ z: "235d8e3d.a7583a",
417
+ name: "",
418
+ active: true,
419
+ tosidebar: true,
420
+ console: false,
421
+ tostatus: false,
422
+ complete: "true",
423
+ targetType: "full",
424
+ statusVal: "",
425
+ statusType: "auto",
426
+ x: 610,
427
+ y: 340,
428
+ wires: [],
429
+ },
430
+ {
431
+ id: "2978fe86.e680aa",
432
+ type: "debug",
433
+ z: "235d8e3d.a7583a",
434
+ name: "",
435
+ active: true,
436
+ tosidebar: true,
437
+ console: false,
438
+ tostatus: false,
439
+ complete: "true",
440
+ targetType: "full",
441
+ statusVal: "",
442
+ statusType: "auto",
443
+ x: 610,
444
+ y: 380,
445
+ wires: [],
446
+ },
447
+ {
448
+ id: "9d9e06be.09718",
449
+ type: "function",
450
+ z: "235d8e3d.a7583a",
451
+ name: "Change Config",
452
+ func: '// Set the main player IP and each IP belonging to the player\'s group\nvar config= {\n setMainPlayerIP:"192.168.1.109",\n setPlayerGroupArray:[\n "192.168.1.110",\n "192.168.1.111",\n "192.168.1.112"\n ]\n};\nmsg.setConfig = config;\nreturn msg;',
453
+ outputs: 1,
454
+ noerr: 0,
455
+ initialize: "",
456
+ finalize: "",
457
+ x: 260,
458
+ y: 360,
459
+ wires: [["4b4514d.047366c"]],
460
+ },
461
+ {
462
+ id: "c3da8b3a.e8f2c8",
463
+ type: "inject",
464
+ z: "235d8e3d.a7583a",
465
+ name: "",
466
+ props: [{ p: "payload" }],
467
+ repeat: "",
468
+ crontab: "",
469
+ once: false,
470
+ onceDelay: 0.1,
471
+ topic: "",
472
+ payload: "Hello",
473
+ payloadType: "str",
474
+ x: 110,
475
+ y: 360,
476
+ wires: [["9d9e06be.09718"]],
477
+ },
478
+ {
479
+ id: "c55b7140.4a7cc8",
480
+ type: "comment",
481
+ z: "235d8e3d.a7583a",
482
+ name: "Change the player and/or group of players via msg property.",
483
+ info: "",
484
+ x: 270,
485
+ y: 300,
486
+ wires: [],
487
+ },
488
+ {
489
+ id: "feee307e.54bca",
490
+ type: "ttsultimate-config",
491
+ name: "Config",
492
+ noderedipaddress: "192.168.1.161",
493
+ noderedport: "1980",
494
+ purgediratrestart: "leave",
495
+ ttsservice: "googletranslate",
496
+ },
497
+ ];
259
498
  ```
499
+
260
500
  </details>
261
501
 
262
502
  <br/>
@@ -273,8 +513,111 @@ return msg;
273
513
  > Adjust the nodes according to your setup
274
514
 
275
515
  ```js
276
- [{"id":"db0ea33.f1186e","type":"ttsultimate","z":"c6efd2b6.ab02e8","name":"","voice":"en-AU-Standard-A#en-AU#FEMALE","ssml":false,"sonosipaddress":"192.168.1.109","sonosvolume":"25","sonoshailing":"Hailing_Hailing.mp3","config":"4f941d61.f52c4c","propertyType":{},"rules":[],"x":670,"y":240,"wires":[[]]},{"id":"c7fb2970.271978","type":"ownfileultimate","z":"c6efd2b6.ab02e8","name":"","selectedFile":"OwnFile_Tur geoeffnet.mp3","x":490,"y":220,"wires":[["db0ea33.f1186e"]]},{"id":"fef80c5b.49f9e","type":"inject","z":"c6efd2b6.ab02e8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":220,"wires":[["c7fb2970.271978"]]},{"id":"807f0f6c.6d59c","type":"comment","z":"c6efd2b6.ab02e8","name":"You can upload your own voice messages and use it with ttsultimate","info":"","x":310,"y":180,"wires":[]},{"id":"536e58b3.bb8468","type":"ownfileultimate","z":"c6efd2b6.ab02e8","name":"","selectedFile":"OwnFile_Tur geoeffnet.mp3","x":490,"y":260,"wires":[["db0ea33.f1186e"]]},{"id":"26c339f9.346fbe","type":"inject","z":"c6efd2b6.ab02e8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":260,"wires":[["25016441.6447bc"]]},{"id":"25016441.6447bc","type":"function","z":"c6efd2b6.ab02e8","name":"Dynamically Select file","func":"// Override the selected file.\nmsg.selectedFile=\"Porta aperta\"\nreturn msg;","outputs":1,"noerr":0,"x":300,"y":260,"wires":[["536e58b3.bb8468"]]},{"id":"4f941d61.f52c4c","type":"ttsultimate-config","z":"","name":"GoogleTTS","noderedipaddress":"192.168.1.219","noderedport":"1980","purgediratrestart":"leave","ttsservice":"googletts"}]
516
+ [
517
+ {
518
+ id: "db0ea33.f1186e",
519
+ type: "ttsultimate",
520
+ z: "c6efd2b6.ab02e8",
521
+ name: "",
522
+ voice: "en-AU-Standard-A#en-AU#FEMALE",
523
+ ssml: false,
524
+ sonosipaddress: "192.168.1.109",
525
+ sonosvolume: "25",
526
+ sonoshailing: "Hailing_Hailing.mp3",
527
+ config: "4f941d61.f52c4c",
528
+ propertyType: {},
529
+ rules: [],
530
+ x: 670,
531
+ y: 240,
532
+ wires: [[]],
533
+ },
534
+ {
535
+ id: "c7fb2970.271978",
536
+ type: "ownfileultimate",
537
+ z: "c6efd2b6.ab02e8",
538
+ name: "",
539
+ selectedFile: "OwnFile_Tur geoeffnet.mp3",
540
+ x: 490,
541
+ y: 220,
542
+ wires: [["db0ea33.f1186e"]],
543
+ },
544
+ {
545
+ id: "fef80c5b.49f9e",
546
+ type: "inject",
547
+ z: "c6efd2b6.ab02e8",
548
+ name: "",
549
+ topic: "",
550
+ payload: "true",
551
+ payloadType: "bool",
552
+ repeat: "",
553
+ crontab: "",
554
+ once: false,
555
+ onceDelay: 0.1,
556
+ x: 130,
557
+ y: 220,
558
+ wires: [["c7fb2970.271978"]],
559
+ },
560
+ {
561
+ id: "807f0f6c.6d59c",
562
+ type: "comment",
563
+ z: "c6efd2b6.ab02e8",
564
+ name: "You can upload your own voice messages and use it with ttsultimate",
565
+ info: "",
566
+ x: 310,
567
+ y: 180,
568
+ wires: [],
569
+ },
570
+ {
571
+ id: "536e58b3.bb8468",
572
+ type: "ownfileultimate",
573
+ z: "c6efd2b6.ab02e8",
574
+ name: "",
575
+ selectedFile: "OwnFile_Tur geoeffnet.mp3",
576
+ x: 490,
577
+ y: 260,
578
+ wires: [["db0ea33.f1186e"]],
579
+ },
580
+ {
581
+ id: "26c339f9.346fbe",
582
+ type: "inject",
583
+ z: "c6efd2b6.ab02e8",
584
+ name: "",
585
+ topic: "",
586
+ payload: "true",
587
+ payloadType: "bool",
588
+ repeat: "",
589
+ crontab: "",
590
+ once: false,
591
+ onceDelay: 0.1,
592
+ x: 130,
593
+ y: 260,
594
+ wires: [["25016441.6447bc"]],
595
+ },
596
+ {
597
+ id: "25016441.6447bc",
598
+ type: "function",
599
+ z: "c6efd2b6.ab02e8",
600
+ name: "Dynamically Select file",
601
+ func: '// Override the selected file.\nmsg.selectedFile="Porta aperta"\nreturn msg;',
602
+ outputs: 1,
603
+ noerr: 0,
604
+ x: 300,
605
+ y: 260,
606
+ wires: [["536e58b3.bb8468"]],
607
+ },
608
+ {
609
+ id: "4f941d61.f52c4c",
610
+ type: "ttsultimate-config",
611
+ z: "",
612
+ name: "GoogleTTS",
613
+ noderedipaddress: "192.168.1.219",
614
+ noderedport: "1980",
615
+ purgediratrestart: "leave",
616
+ ttsservice: "googletts",
617
+ },
618
+ ];
277
619
  ```
620
+
278
621
  </details>
279
622
 
280
623
  This node allow you to upload your custom message and play it via ttsultimate without the need of an internet connection. You can use it, for example, with your alarm panel, to annuce a zone breach, a doorbell or so.
@@ -287,9 +630,9 @@ Select a file to be played. You can upload one or multiple files at the same tim
287
630
 
288
631
  **Priority**<br/>
289
632
  If set to <b>true</b>, the OwnFile message will cancel the current TTS queue, will stop the current phrase being spoken and the TTS-Ultimate node will play this priority message.<br/>
290
- Please refer to *msg.priority* msg input property of TTS-Ultimate for info on how this message will be handled<br/>
633
+ Please refer to _msg.priority_ msg input property of TTS-Ultimate for info on how this message will be handled<br/>
291
634
 
292
- ## INPUT MESSAGE
635
+ ## INPUT MESSAGE
293
636
 
294
637
  **msg.payload = true**<br/>
295
638
  Begin play of the message <br/>
@@ -299,11 +642,10 @@ Overrides the selected message and plays the filename you passed in. Please doub
299
642
 
300
643
  **msg.priority**<br/>
301
644
  If set to <b>true</b>, the OwnFile message will cancel the current TTS queue, will stop the current phrase being spoken and the TTS-Ultimate node will play this priority message.<br/>
302
- Please refer to *msg.priority* msg input property of TTS-Ultimate for info on how this message will be handled<br/>
303
-
645
+ Please refer to _msg.priority_ msg input property of TTS-Ultimate for info on how this message will be handled<br/>
304
646
 
305
647
  ![Logo](https://raw.githubusercontent.com/Supergiovane/node-red-contrib-tts-ultimate/master/img/madeinitaly.png)
306
-
648
+
307
649
  [license-image]: https://img.shields.io/badge/license-MIT-blue.svg
308
650
  [license-url]: https://github.com/Supergiovane/node-red-contrib-tts-ultimate/master/LICENSE
309
651
  [npm-url]: https://npmjs.org/package/node-red-contrib-tts-ultimate