node-red-contrib-tts-ultimate 1.0.49 → 1.0.50

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/CHANGELOG.md CHANGED
@@ -2,9 +2,14 @@
2
2
 
3
3
  [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
4
4
 
5
+ <p>
6
+ <b>Version 1.0.50</b> August 2022<br/>
7
+ - Fixed a wrong "sonos unreachable" message when you select to simply save the file instead of using it with sonos<br/>
8
+ - FIX: temporary fix for chinese language in google translate engine, that was not working anymore.<br/>
9
+ </p>
5
10
  <p>
6
11
  <b>Version 1.0.49</b> June 2022<br/>
7
- - Due to Microsoft Azure SDK limitation, the node can only be installed on systems wit NodeJS versions: (^12.22.0, ^14.17.0, or >=16.0.0) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.). Currently, the Microsoft Azure SDK and, thus, TTS-Ultimate, doesn't run on NodeJS 18.x.x !!<br/>
12
+ - Due to Microsoft Azure SDK limitation, the node can only be installed on systems with NodeJS versions: (^12.22.0, ^14.17.0, or >=16.0.0) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.). Currently, the Microsoft Azure SDK and, thus, TTS-Ultimate, doesn't run on NodeJS 18.x.x !!<br/>
8
13
  </p>
9
14
  <p>
10
15
  <b>Version 1.0.48</b> Mai 2022<br/>
package/README.md CHANGED
@@ -21,7 +21,7 @@
21
21
  </details>
22
22
 
23
23
  ## WARNING
24
- Due to Microsoft Azure SDK limitation, the node can only be installed on systems wit **NodeJS** versions: (^12.22.0, ^14.17.0, or >=16.0.0) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.). Currently, the **Microsoft Azure SDK and, thus, TTS-Ultimate, doesn't run on NodeJS 18.x.x !!**
24
+ Due to Microsoft Azure SDK limitation, the node can only be installed on systems with **NodeJS** versions: (^12.22.0, ^14.17.0, or >=16.0.0) built with SSL support. (If you are using an official Node.js distribution, SSL is always built in.). Currently, the **Microsoft Azure SDK and, thus, TTS-Ultimate, doesn't run on NodeJS 18.x.x !!**
25
25
 
26
26
  ## DESCRIPTION
27
27
  This node transforms a text into a speech audio that you can hear natively via <b>SONOS</b> speakers.<br/>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-tts-ultimate",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "description": "Transforms the text in speech and hear it using Sonos player or generate an audio file to be used with third parties nodes. Works with voices from Amazon, Google (without credentials as well), Microsoft TTS Azure, or your own voice. You can also only create a TTS file to be read by third party nodes. Update of the popular SonosPollyTTS node.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -47,7 +47,7 @@
47
47
  "os": ">=0.1.1",
48
48
  "path": ">=0.12.7",
49
49
  "@google-cloud/text-to-speech": "3.4.0",
50
- "google-translate-tts": ">=0.2.1",
50
+ "google-translate-tts": ">=0.3.0",
51
51
  "microsoft-cognitiveservices-speech-sdk": "1.21.1"
52
52
  },
53
53
  "devDependencies": {
@@ -285,7 +285,7 @@ module.exports = function (RED) {
285
285
  // 30/03/2020 in the middle of coronavirus emergency. Group Speakers
286
286
  for (let index = 0; index < node.oAdditionalSonosPlayers.length; index++) {
287
287
  let element = node.oAdditionalSonosPlayers[index].oPlayer;
288
-
288
+
289
289
  // 02/07/2021 Get the additional's player's volume set by app and the current track, to be set again in ungroupspealers
290
290
  try {
291
291
  element.additionalPlayerPreviousVolumeSetByApp = await element.getVolume();
@@ -366,29 +366,35 @@ module.exports = function (RED) {
366
366
 
367
367
 
368
368
  // 27/11/2019 Check Sonos connection health
369
- node.CheckSonosConnection = () => {
370
369
 
371
- node.SonosClient.getCurrentState().then(state => {
370
+ node.CheckSonosConnection = () => {
371
+ if (node.playertype !== "noplayer") {
372
+ node.SonosClient.getCurrentState().then(state => {
373
+
374
+ // 11/12/202020 The connection with Sonos is OK.
375
+ if (node.msg.connectionerror == true) {
376
+ node.flushQueue();
377
+ node.setNodeStatus({ fill: "green", shape: "dot", text: "Sonos is connected." });
378
+ node.msg.connectionerror = false;
379
+ node.send([null, { payload: node.msg.connectionerror }]);
380
+ }
381
+ node.oTimerSonosConnectionCheck = setTimeout(function () { node.CheckSonosConnection(); }, 5000);
372
382
 
373
- // 11/12/202020 The connection with Sonos is OK.
374
- if (node.msg.connectionerror == true) {
383
+ }).catch(err => {
384
+ node.setNodeStatus({ fill: "red", shape: "dot", text: "Sonos connection is DOWN: " + err.message });
375
385
  node.flushQueue();
376
- node.setNodeStatus({ fill: "green", shape: "dot", text: "Sonos is connected." });
377
- node.msg.connectionerror = false;
378
- node.send([null, { payload: node.msg.connectionerror }]);
379
- }
380
- node.oTimerSonosConnectionCheck = setTimeout(function () { node.CheckSonosConnection(); }, 5000);
381
-
382
- }).catch(err => {
383
- node.setNodeStatus({ fill: "red", shape: "dot", text: "Sonos connection is DOWN: " + err.message });
384
- node.flushQueue();
385
- // 11/12/2020 Set node output to signal connectio error
386
- if (node.msg.connectionerror == false) {
387
- node.msg.connectionerror = true;
388
- node.send([null, { payload: node.msg.connectionerror }]);
389
- }
390
- node.oTimerSonosConnectionCheck = setTimeout(function () { node.CheckSonosConnection(); }, 10000);
391
- });
386
+ // 11/12/2020 Set node output to signal connectio error
387
+ if (node.msg.connectionerror == false) {
388
+ node.msg.connectionerror = true;
389
+ node.send([null, { payload: node.msg.connectionerror }]);
390
+ }
391
+ node.oTimerSonosConnectionCheck = setTimeout(function () { node.CheckSonosConnection(); }, 10000);
392
+ });
393
+ } else {
394
+ node.setNodeStatus({ fill: "green", shape: "dot", text: "Sonos is connected." });
395
+ node.msg.connectionerror = false;
396
+ node.send([null, { payload: node.msg.connectionerror }]);
397
+ }
392
398
 
393
399
  }
394
400
 
@@ -614,6 +620,7 @@ module.exports = function (RED) {
614
620
  } else if (node.server.ttsservice === "googletranslate") {
615
621
  node.setNodeStatus({ fill: 'green', shape: 'ring', text: 'Downloading from Google Translate...' });
616
622
  // VoiceId is: code. SSML is not supported by google translate
623
+ if (node.voiceId === "cmn-Hant-TW") node.voiceId = "zh-CN"; // 06/08/2022 fix for a wrong voiceid sent by google translate as voice code
617
624
  const params = {
618
625
  text: msg,
619
626
  voice: node.voiceId,
@@ -894,7 +901,7 @@ module.exports = function (RED) {
894
901
  // *********************************
895
902
 
896
903
  // In case of connection error, doesn't accept any message
897
- if (node.msg.connectionerror) {
904
+ if (node.msg.connectionerror && node.playertype !== "noplayer") {
898
905
  RED.log.warn("ttsultimate: Sonos is offline. The new msg coming from the flow will be rejected.");
899
906
  node.setNodeStatus({ fill: 'red', shape: 'ring', text: "Sonos is offline. The msg has been rejected." });
900
907
  return;