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

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,7 +2,10 @@
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
-
5
+ <p>
6
+ <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/>
8
+ </p>
6
9
  <p>
7
10
  <b>Version 1.0.48</b> Mai 2022<br/>
8
11
  - Try to fixe a clunky issue with microsoft azure package, on nodejs versions that are not supported by Microsoft.<br/>
package/README.md CHANGED
@@ -20,6 +20,8 @@
20
20
  ```
21
21
  </details>
22
22
 
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 !!**
23
25
 
24
26
  ## DESCRIPTION
25
27
  This node transforms a text into a speech audio that you can hear natively via <b>SONOS</b> speakers.<br/>
@@ -27,7 +29,7 @@ You can also generate an audio file for bluetooth speakers, web pages, etc.<br/>
27
29
  Uses Amazon Polly (standard and neural engines), Google TTS voices (even without credentials nor registration) and Microsoft TTS Azure voices, and you can 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
30
  The node can also create a ***TTS file (without the use of any Sonos device)***, to be read by third parties nodes.<br/>
29
31
  This is a major ***upgrade from the previously popular node SonosPollyTTS*** (SonosPollyTTS is not developed anymore).<br/>
30
- **Node v.12.0.0 or newer is needed**.
32
+
31
33
 
32
34
  [![Donate via PayPal](https://img.shields.io/badge/Donate-PayPal-blue.svg?style=flat-square)](https://www.paypal.me/techtoday)
33
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-red-contrib-tts-ultimate",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
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": {
@@ -48,7 +48,7 @@
48
48
  "path": ">=0.12.7",
49
49
  "@google-cloud/text-to-speech": "3.4.0",
50
50
  "google-translate-tts": ">=0.2.1",
51
- "microsoft-cognitiveservices-speech-sdk": "1.19.0"
51
+ "microsoft-cognitiveservices-speech-sdk": "1.21.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "eslint": ">=4.18.2",
@@ -1,6 +1,16 @@
1
+ const { Redshift } = require('aws-sdk');
2
+
1
3
  module.exports = function (RED) {
2
4
  'use strict';
3
5
 
6
+ // 31/05/2022 checking nodejs version due to Microsoft Azure SDK bad nodejs compatibility.
7
+ let nodejsVersion = process.version.match(/^v(\d+\.\d+)/)[1];
8
+ if (nodejsVersion.startsWith("18")) {
9
+ RED.log.error('ttsultimate-config: YOUR NODEJS VERSION IS CURRENTLY INCOMPATIBLE WITH Microsoft Azure SDK. Your NodeJS version: ' + nodejsVersion + ", please install one of these: (^12.22.0, ^14.17.0, or >=16.0.0), with SSL support.");
10
+ }
11
+
12
+
13
+
4
14
  const AWS = require('aws-sdk');
5
15
  const GoogleTTS = require('@google-cloud/text-to-speech');
6
16
  const GoogleTranslate = require('google-translate-tts'); // TTS without credentials, limited to 200 chars per row.
@@ -27,10 +37,7 @@ module.exports = function (RED) {
27
37
  node.whoIsUsingTheServer = ""; // Client node.id using the server, because only a ttsultimate node can use the serve at once.
28
38
  node.ttsservice = config.ttsservice || "googletranslate";
29
39
  node.TTSRootFolderPath = (config.TTSRootFolderPath === undefined || config.TTSRootFolderPath === "") ? path.join(RED.settings.userDir, "sonospollyttsstorage") : path.join(config.TTSRootFolderPath, "sonospollyttsstorage");
30
- // node.polly = null;
31
- // node.googleTTS = null;
32
- // node.googleTranslateTTS = null;
33
- // node.microsoftAzureTTS = null;
40
+
34
41
 
35
42
  // 03/06/2019 you can select the temp dir
36
43
  //#region "SETUP PATHS"
@@ -236,12 +243,12 @@ module.exports = function (RED) {
236
243
  })
237
244
  } catch (error) { }
238
245
  if (jListInterfaces.length > 0) {
239
- return(jListInterfaces[0].address); // Retunr the first usable IP
246
+ return (jListInterfaces[0].address); // Retunr the first usable IP
240
247
  } else {
241
- return("NO ETH INTERFACE FOUND");
248
+ return ("NO ETH INTERFACE FOUND");
242
249
  }
243
250
  }
244
-
251
+
245
252
  // 20/03/2020 in the middle of coronavirus, get the sonos groups
246
253
  RED.httpAdmin.get("/sonosgetAllGroups", RED.auth.needsPermission('TTSConfigNode.read'), function (req, res) {
247
254
  var jListGroups = [];