iobroker.sayit 3.0.4 → 4.0.1
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/LICENSE +1 -1
- package/README.md +55 -46
- package/admin/blockly.js +25 -35
- package/admin/i18n/de/translations.json +93 -54
- package/admin/i18n/en/translations.json +93 -54
- package/admin/i18n/es/translations.json +93 -54
- package/admin/i18n/fr/translations.json +93 -54
- package/admin/i18n/it/translations.json +93 -54
- package/admin/i18n/nl/translations.json +93 -54
- package/admin/i18n/pl/translations.json +93 -54
- package/admin/i18n/pt/translations.json +93 -54
- package/admin/i18n/ru/translations.json +93 -54
- package/admin/i18n/uk/translations.json +93 -54
- package/admin/i18n/zh-cn/translations.json +93 -54
- package/admin/jsonConfig.json +23 -0
- package/admin/words.js +98 -44
- package/io-package.json +48 -16
- package/lib/speech2device.js +49 -4
- package/main.js +15 -16
- package/package.json +12 -11
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2015-
|
|
3
|
+
Copyright (c) 2015-2024 bluefox <dogafox@gmail.com>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
SayIt Adapter can convert text to speech and play it on some device.
|
|
15
15
|
|
|
16
16
|
## Configuration
|
|
17
|
-
|
|
17
|
+
Actually, the following outputs are supported:
|
|
18
18
|
|
|
19
19
|
- *Browser* - the text will be played by browser with opened `iobroker.vis` page. It is supported almost by every desktop browser and by few mobile Browsers.
|
|
20
20
|
|
|
21
21
|
- *[Home24- MediaPlayer](http://www.home-24.net/index.php?app=media)* - the text will be sent and played to the Android device with Home24 - MediaPlayer installed. For this will be used build in Android text to speech engine. The port cannot be changed and set to 50000.
|
|
22
22
|
|
|
23
|
-
- *Home24 - MediaPlayer and [FTP Server](https://play.google.com/store/apps/details?id=lutey.FTPServer)* - the text will be sent and played on the Android device with Home24 - MediaPlayer installed. For this will be used the Google text to speech engine. Generated mp3 file will be copied over FTP to
|
|
23
|
+
- *Home24 - MediaPlayer and [FTP Server](https://play.google.com/store/apps/details?id=lutey.FTPServer)* - the text will be sent and played on the Android device with Home24 - MediaPlayer installed. For this will be used the Google text to speech engine. Generated mp3 file will be copied over FTP to an Android device and played with Home24 - MediaPlayer.
|
|
24
24
|
Both apps have to have same home directories. (E.g. root directory of \"sd card\").
|
|
25
25
|
|
|
26
26
|
- *System* - the text will be played by OS, where the ioBroker adapter runs. Following OS are supported: Windows, linux, Mac OSx.
|
|
27
27
|
|
|
28
|
-
- *Windows engine* - the text will be played by windows, where the sayIt adapter runs. For this will be used
|
|
28
|
+
- *Windows engine* - the text will be played by windows, where the sayIt adapter runs. For this will be used the Windows text to speech engine, that should be preconfigured by user. You can check [here](http://windows.microsoft.com/en-us/windows/setting-speech-options#1TC=windows-7) how to set up it.
|
|
29
29
|
|
|
30
|
-
- *Sonos* - play text on
|
|
30
|
+
- *Sonos* - play text on the Sonos device. Be sure the Web Adapter is enabled. It is required to enable SONOS to read the generated mp3 files.
|
|
31
31
|
|
|
32
32
|
- *Heos* - play text on HEOS device. Be sure the Web Adapter is enabled. It is required to enable HEOS to read the generated mp3 files.
|
|
33
33
|
|
|
34
|
-
- *Chromecast* - play text on Chromecast device.
|
|
34
|
+
- *Chromecast* - play text on a Chromecast device.
|
|
35
35
|
|
|
36
36
|
- *MPD* - play text on Music Player Daemon. Use only **http** for web adapter, don't use https.
|
|
37
37
|
|
|
@@ -42,21 +42,21 @@ The mp3/wav files can be played to by writing its name into the object. (e.g. `/
|
|
|
42
42
|
The file must be first loaded.
|
|
43
43
|
|
|
44
44
|
### TTS engines
|
|
45
|
-
|
|
45
|
+
Online:
|
|
46
46
|
- Google: English, German, Russian, Italian, Spanish, French;
|
|
47
47
|
- Yandex: Russian
|
|
48
48
|
To use Yandex voices you must request the API key here: [https://tech.yandex.ru/speechkit/cloud/doc/dg/concepts/About-docpage/](https://tech.yandex.ru/speechkit/cloud/doc/dg/concepts/About-docpage/). [This service will be disabled 1st of Jan 2019 and replaced by Yandex.cloud]
|
|
49
49
|
To use Yandex.cloud you should register here: [https://cloud.yandex.ru/], install SpeechKIT API in the Cloud and get Auth Token and Folder ID as described in API instructions.
|
|
50
50
|
- Cloud: To use Cloud voices you need configured and running `cloud` adapter or enter app-key directly in settings
|
|
51
51
|
- Amazon Web Services Polly:
|
|
52
|
-
To use AWS Polly voices you need to create access key and secret key [here](https://console.aws.amazon.com/iam/home). The Amazon documentation can you find [here](http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html).
|
|
52
|
+
To use AWS Polly voices you need to create an access key and secret key [here](https://console.aws.amazon.com/iam/home). The Amazon documentation can you find [here](http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html).
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
Offline:
|
|
55
55
|
- PicoTTS (linux only): English, German, Italian, Spanish, French;
|
|
56
56
|
For PicoTTS it is necessary to install the following packages: `libttspico-utils` and lame.
|
|
57
57
|
Installation command: `sudo apt-get install libttspico-utils lame`
|
|
58
58
|
|
|
59
|
-
- Coqui TTS:
|
|
59
|
+
- Coqui TTS: English, German, Spanish, French, Dutch, Japanese, Chinese;
|
|
60
60
|
For instructions how to use go to the [official documentation](https://tts.readthedocs.io/en/latest/index.html)
|
|
61
61
|
|
|
62
62
|
### Cloud and Amazon Web Services Polly text formatting
|
|
@@ -75,11 +75,11 @@ If you have some program, that can play audio files locally or somewhere else, y
|
|
|
75
75
|
|
|
76
76
|
```myCustomPlayer --option```
|
|
77
77
|
|
|
78
|
-
If **System** output is selected, the `sayit` adapter will execute following command on local system:
|
|
78
|
+
If **System** output is selected, the `sayit` adapter will execute the following command on a local system:
|
|
79
79
|
|
|
80
80
|
```myCustomPlayer --option /opt/iobroker/node_modules/iobroker.sayit/say.mp3```
|
|
81
81
|
|
|
82
|
-
If file name must stay somewhere in the middle you can use *%s* to specify where the file name must be placed:
|
|
82
|
+
If file name must stay somewhere in the middle, you can use *%s* to specify where the file name must be placed:
|
|
83
83
|
|
|
84
84
|
```myCustomPlayer --option "%s" > /dev/null```
|
|
85
85
|
|
|
@@ -87,33 +87,33 @@ sayIt will make ```myCustomPlayer --option "/opt/iobroker/node_modules/iobroker.
|
|
|
87
87
|
|
|
88
88
|
## Usage
|
|
89
89
|
SayIt adapter cannot be used alone. It must be controlled from javascript adapter or from "vis" with specific widget.
|
|
90
|
-
After creation of adapter instance you can find following objects:
|
|
90
|
+
After creation of adapter instance, you can find the following objects:
|
|
91
91
|
- `sayit.N.tts.text`: Phrase to be spoken.
|
|
92
92
|
- `sayit.N.tts.volume`: volume which will be used by playing of the phrase.
|
|
93
|
-
- `sayit.N.tts.playing`: true if text is now playing and false if not. Supported only for "windows" and "system" play mode.
|
|
94
|
-
- `sayit.N.tts.cachetext`: Phrase to be cached, and then it can be used without internet.
|
|
95
|
-
E.g
|
|
93
|
+
- `sayit.N.tts.playing`: true if a text is now playing and false if not. Supported only for "windows" and "system" play mode.
|
|
94
|
+
- `sayit.N.tts.cachetext`: Phrase to be cached, and then it can be used without an internet.
|
|
95
|
+
E.g., you can enter here manually "No internet" and if ping to google.com is negative, write "No internet" to "tts.text" and it will be pronounced. Of course, cache must be enabled.
|
|
96
96
|
|
|
97
|
-
State
|
|
98
|
-
E.g
|
|
97
|
+
State `tts.text` supports extended syntax, so the language/engine and volume can be defined together with text. It is used to enable multi-language text2speech engines.
|
|
98
|
+
E.g., if adapter has engine "Google-english", it is possible with phrase ```de:Sag es``` to force using Google-Deutsch speech engine.
|
|
99
99
|
|
|
100
100
|
With ```ru;75;Погода хорошая``` we can force using russian language and volume 75%.
|
|
101
101
|
|
|
102
|
-
You can specify the volume of announcement in percent from current or given volume (not from maximal). E.g
|
|
102
|
+
You can specify the volume of announcement in percent from current or given volume (not from maximal). E.g., if command is ```de;75;Gutes Wetter```and "announce volume" is 50%, the announcement will be played with volume 38% from 100% possible.
|
|
103
103
|
|
|
104
104
|
The system command to play the mp3 file can be specified too. If you leave it blank, the default settings will be used: windows - `cmdmp3.exe`, OSX - `/usr/bin/afplay`, linux - `mpg321` or `omxplayer` (recommended).
|
|
105
105
|
|
|
106
106
|
To install omxplayer write ```sudo apt-get install omxplayer``` or write ```sudo apt-get install mpg321``` to install mpg321.
|
|
107
107
|
|
|
108
|
-
**Note:** The default announce selection will be possible only after start of the instance.
|
|
108
|
+
**Note:** The default announce selection will be possible only after the start of the instance.
|
|
109
109
|
|
|
110
110
|
### Priorities
|
|
111
|
-
To immediately pronounce the text despite the queued texts you have 2 possibilities:
|
|
112
|
-
- place "!" as a first character in text, so this text will be pronounced immediately after current one.
|
|
113
|
-
- write true into "tts.clearQueue" state and the queue will be cleared. After that you can write a new text into
|
|
111
|
+
To immediately pronounce the text despite the queued texts, you have 2 possibilities:
|
|
112
|
+
- place "!" as a first character in text, so this text will be pronounced immediately after the current one.
|
|
113
|
+
- write true into "tts.clearQueue" state and the queue will be cleared. After that you can write a new text into `tts.text`, but all queued texts are thrown away.
|
|
114
114
|
|
|
115
115
|
### Engines
|
|
116
|
-
|
|
116
|
+
The following values for engines are possible:
|
|
117
117
|
|
|
118
118
|
#### Google
|
|
119
119
|
- **en** - English
|
|
@@ -267,16 +267,25 @@ Following values for engines are possible:
|
|
|
267
267
|
### **WORK IN PROGRESS**
|
|
268
268
|
-->
|
|
269
269
|
## Changelog
|
|
270
|
-
###
|
|
270
|
+
### 4.0.1 (2024-05-25)
|
|
271
|
+
* (bluefox) Packages updated
|
|
272
|
+
* (neopholus) Using the pre-calculated duration of the mp3 to wait long enough even for longer announcements
|
|
273
|
+
|
|
274
|
+
### 4.0.0 (2023-10-31)
|
|
275
|
+
* (bluefox) Breaking changes: A minimal node.js version is 16
|
|
276
|
+
* (bluefox) Browser outputs now to vis(1) and vis-2
|
|
277
|
+
|
|
278
|
+
### 3.0.5 (2023-04-17)
|
|
271
279
|
* (bluefox) Corrected error with System player
|
|
272
280
|
* (bluefox) Do not allow for chromecast to cache files.
|
|
273
281
|
* (bluefox) Allowed to add cloud App-Key without running cloud adapter
|
|
274
282
|
* (bluefox) Added austrian language
|
|
275
283
|
* (bluefox) Added norwegian language
|
|
284
|
+
* (klein0r) Used sendTo instead of setState in blockly
|
|
276
285
|
|
|
277
286
|
### 3.0.0 (2023-04-03)
|
|
278
287
|
* (bluefox) Restored cloud engines. Warning: update cloud adapter to at least 4.4.0
|
|
279
|
-
* (bluefox) Breaking changes:
|
|
288
|
+
* (bluefox) Breaking changes: A minimal node.js version is 14
|
|
280
289
|
|
|
281
290
|
### 2.1.2 (2023-03-27)
|
|
282
291
|
* (bluefox) Corrected engines with web-link
|
|
@@ -322,7 +331,7 @@ Following values for engines are possible:
|
|
|
322
331
|
|
|
323
332
|
### 1.11.0 (2020-08-02)
|
|
324
333
|
* (Apollon77) Move the generated mp3 file to an own directory in iobroker-data instead of inside node_modules (Hopefully not breaking)
|
|
325
|
-
* (Apollon77) Change File write to use Sync methods to make sure they
|
|
334
|
+
* (Apollon77) Change File write to use Sync methods to make sure they cannot run in parallel
|
|
326
335
|
|
|
327
336
|
### 1.10.2 (2020-07-19)
|
|
328
337
|
* (Apollon77) Crash case prevented (Sentry IOBROKER-SAYIT-8)
|
|
@@ -335,13 +344,13 @@ Following values for engines are possible:
|
|
|
335
344
|
* (algar42) GUI updated to fill drop-downs correctly. Premium voices added to Yandex.Cloud engine
|
|
336
345
|
|
|
337
346
|
### 1.9.8 (2020-06-11)
|
|
338
|
-
* (Apollon77)
|
|
347
|
+
* (Apollon77) fixed error handling on file copy
|
|
339
348
|
|
|
340
349
|
### 1.9.7 (2020-06-11)
|
|
341
350
|
* (algar42) tts.ogg state added for ogg file type
|
|
342
351
|
|
|
343
352
|
### 1.9.6 (2020-05-24)
|
|
344
|
-
* (bluefox)
|
|
353
|
+
* (bluefox) Showed names of SONOS devices
|
|
345
354
|
|
|
346
355
|
### 1.9.4 (2020-05-11)
|
|
347
356
|
* (Apollon77) Fix Blockly
|
|
@@ -386,7 +395,7 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
386
395
|
* (bondrogeen) Admin3 Fixes
|
|
387
396
|
|
|
388
397
|
### 1.6.6 (2017-11-27)
|
|
389
|
-
* (angelnu) Wait for Google Home announcement to complete
|
|
398
|
+
* (angelnu) Wait for a Google Home announcement to complete
|
|
390
399
|
|
|
391
400
|
### 1.6.5 (2017-11-04)
|
|
392
401
|
* (bluefox) Fix cloud .pro
|
|
@@ -410,7 +419,7 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
410
419
|
* (bluefox) Add cloud as source
|
|
411
420
|
|
|
412
421
|
### 1.4.0 (2017-01-16)
|
|
413
|
-
* (bluefox)
|
|
422
|
+
* (bluefox) fixed install problem
|
|
414
423
|
* (bluefox) add PicoTTS as source
|
|
415
424
|
|
|
416
425
|
### 1.3.3 (2017-01-13)
|
|
@@ -420,7 +429,7 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
420
429
|
* (angelnu) changes for new chromecast tts
|
|
421
430
|
|
|
422
431
|
### 1.3.1 (2016-12-27)
|
|
423
|
-
* (bluefox) small
|
|
432
|
+
* (bluefox) small fixed of config dialog
|
|
424
433
|
* (AirKing555) Fix Volume change
|
|
425
434
|
|
|
426
435
|
### 1.3.0 (2016-12-20)
|
|
@@ -454,13 +463,13 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
454
463
|
* (bluefox) fill default settings by first start
|
|
455
464
|
|
|
456
465
|
### 0.3.14 (2015-11-01)
|
|
457
|
-
* (bluefox)
|
|
466
|
+
* (bluefox) fixed error with sayItWindows
|
|
458
467
|
|
|
459
468
|
### 0.3.13 (2015-10-27)
|
|
460
|
-
* (bluefox)
|
|
469
|
+
* (bluefox) fixed error with sayItSystem
|
|
461
470
|
|
|
462
471
|
### 0.3.12 (2015-10-06)
|
|
463
|
-
* (bluefox)
|
|
472
|
+
* (bluefox) fixed error if received mp3 file is too short
|
|
464
473
|
* (bluefox) try to implement cache datapoint (you can use sayit.0.tts.cachetext to create cache for phrases and use sayit without internet)
|
|
465
474
|
|
|
466
475
|
### 0.3.11 (2015-08-03)
|
|
@@ -468,27 +477,27 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
468
477
|
|
|
469
478
|
### 0.3.10 (2015-07-26)
|
|
470
479
|
* (bluefox) add new voice Russian-Maxim
|
|
471
|
-
* (bluefox)
|
|
480
|
+
* (bluefox) fixed error with mp24ftp
|
|
472
481
|
|
|
473
482
|
### 0.3.9 (2015-07-09)
|
|
474
|
-
* (bluefox)
|
|
483
|
+
* (bluefox) fixed error by mediaplayer24
|
|
475
484
|
|
|
476
485
|
### 0.3.8 (2015-06-09)
|
|
477
|
-
* (bluefox) make the volume for
|
|
486
|
+
* (bluefox) make the volume for announcement configurable
|
|
478
487
|
* (bluefox) make the command for "system" configurable
|
|
479
488
|
|
|
480
489
|
### 0.3.7 (2015-05-28)
|
|
481
|
-
* (bluefox)
|
|
482
|
-
* (bluefox) support
|
|
490
|
+
* (bluefox) fixed volume for an announcement
|
|
491
|
+
* (bluefox) support for play files from internal filesystem, like "/sayit.0/tts.userfiles/myGong.mp3"
|
|
483
492
|
|
|
484
493
|
### 0.3.6 (2015-03-24)
|
|
485
|
-
* (bluefox)
|
|
494
|
+
* (bluefox) fixed error with volume by sonos
|
|
486
495
|
|
|
487
496
|
### 0.3.5 (2015-03-22)
|
|
488
|
-
* (bluefox)
|
|
497
|
+
* (bluefox) fixed error in an announcement
|
|
489
498
|
|
|
490
499
|
### 0.3.4 (2015-03-20)
|
|
491
|
-
* (bluefox)
|
|
500
|
+
* (bluefox) fixed error in an announcement
|
|
492
501
|
|
|
493
502
|
### 0.3.3 (2015-03-20)
|
|
494
503
|
* (bluefox) enable announcement
|
|
@@ -497,16 +506,16 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
497
506
|
* (bluefox) clear cache if engine changed
|
|
498
507
|
|
|
499
508
|
### 0.3.1 (2015-03-15)
|
|
500
|
-
* (bluefox)
|
|
509
|
+
* (bluefox) fixed small error with log
|
|
501
510
|
|
|
502
511
|
### 0.3.0 (2015-03-08)
|
|
503
512
|
* (bluefox) add ivona/Amazon voices
|
|
504
513
|
|
|
505
514
|
### 0.2.2 (2015-03-08)
|
|
506
|
-
* (bluefox)
|
|
515
|
+
* (bluefox) fixed error by buffering of non-generated texts.
|
|
507
516
|
|
|
508
517
|
### 0.2.1 (2015-03-07)
|
|
509
|
-
* (bluefox)
|
|
518
|
+
* (bluefox) fixed error by buffering of non-generated texts.
|
|
510
519
|
|
|
511
520
|
### 0.2.0 (2015-03-02)
|
|
512
521
|
* (bluefox) add yandex-russian support
|
|
@@ -521,7 +530,7 @@ Changed type of top-level object to "meta" in order to comply with js-controller
|
|
|
521
530
|
|
|
522
531
|
The MIT License (MIT)
|
|
523
532
|
|
|
524
|
-
Copyright (c) 2014-
|
|
533
|
+
Copyright (c) 2014-2024, bluefox <dogafox@gmail.com>
|
|
525
534
|
|
|
526
535
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
527
536
|
of this software and associated documentation files (the "Software"), to deal
|
package/admin/blockly.js
CHANGED
|
@@ -32,8 +32,7 @@ Blockly.Words['sayit_log_debug'] = {'en': 'debug', 'de
|
|
|
32
32
|
Blockly.Words['sayit_log_warn'] = {'en': 'warning', 'de': 'warning', 'ru': 'warning'};
|
|
33
33
|
Blockly.Words['sayit_log_error'] = {'en': 'error', 'de': 'error', 'ru': 'ошибка'};
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
// this is copy of engines.js
|
|
35
|
+
// this is copy of lib/engines.js
|
|
37
36
|
const sayitEngines = {
|
|
38
37
|
"en": {name: "Google - English", engine: "google", params: []},
|
|
39
38
|
"de": {name: "Google - Deutsch", engine: "google", params: []},
|
|
@@ -234,36 +233,37 @@ Blockly.Sendto.blocks['sayit'] =
|
|
|
234
233
|
|
|
235
234
|
Blockly.Blocks['sayit'] = {
|
|
236
235
|
init: function() {
|
|
237
|
-
|
|
236
|
+
const options = [];
|
|
238
237
|
if (typeof main !== 'undefined' && main.instances) {
|
|
239
|
-
for (
|
|
240
|
-
|
|
238
|
+
for (let i = 0; i < main.instances.length; i++) {
|
|
239
|
+
const m = main.instances[i].match(/^system.adapter.sayit.(\d+)$/);
|
|
241
240
|
if (m) {
|
|
242
|
-
|
|
241
|
+
const n = parseInt(m[1], 10);
|
|
243
242
|
options.push(['sayit.' + n, '.' + n]);
|
|
244
243
|
}
|
|
245
244
|
}
|
|
246
245
|
}
|
|
247
246
|
|
|
248
|
-
if (options.length
|
|
249
|
-
for (
|
|
250
|
-
options.push(['sayit.' +
|
|
247
|
+
if (!options.length) {
|
|
248
|
+
for (let k = 0; k <= 4; k++) {
|
|
249
|
+
options.push(['sayit.' + k, '.' + k]);
|
|
251
250
|
}
|
|
252
251
|
}
|
|
252
|
+
options.unshift([Blockly.Translate('sayit_anyInstance'), '']);
|
|
253
253
|
|
|
254
254
|
this.appendDummyInput('INSTANCE')
|
|
255
255
|
.appendField(Blockly.Translate('sayit'))
|
|
256
256
|
.appendField(new Blockly.FieldDropdown(options), 'INSTANCE');
|
|
257
257
|
|
|
258
|
-
|
|
259
|
-
for (
|
|
258
|
+
const languages = [[Blockly.Translate('sayit_configured'), '']];
|
|
259
|
+
for (const l in sayitEngines) {
|
|
260
260
|
if (sayitEngines.hasOwnProperty(l)) languages.push([sayitEngines[l].name, l]);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
this.appendDummyInput('LANGUAGE')
|
|
264
264
|
.appendField(new Blockly.FieldDropdown(languages), 'LANGUAGE');
|
|
265
265
|
|
|
266
|
-
|
|
266
|
+
const input = this.appendValueInput('VOLUME')
|
|
267
267
|
.setCheck('Number')
|
|
268
268
|
.appendField(Blockly.Translate('sayit_volume'));
|
|
269
269
|
if (input.connection) input.connection._optional = true;
|
|
@@ -292,30 +292,20 @@ Blockly.Blocks['sayit'] = {
|
|
|
292
292
|
};
|
|
293
293
|
|
|
294
294
|
Blockly.JavaScript['sayit'] = function(block) {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
var logLevel = block.getFieldValue('LOG');
|
|
295
|
+
const language = block.getFieldValue('LANGUAGE');
|
|
296
|
+
const text = Blockly.JavaScript.valueToCode(block, 'MESSAGE', Blockly.JavaScript.ORDER_ATOMIC);
|
|
297
|
+
const volume = Blockly.JavaScript.valueToCode(block, 'VOLUME', Blockly.JavaScript.ORDER_ATOMIC);
|
|
298
|
+
const logLevel = block.getFieldValue('LOG');
|
|
300
299
|
|
|
301
|
-
|
|
300
|
+
let logText = '';
|
|
302
301
|
if (logLevel) {
|
|
303
|
-
logText = '
|
|
304
|
-
} else {
|
|
305
|
-
logText = '';
|
|
302
|
+
logText = '\nconsole.' + logLevel + '("Executed sayit' + block.getFieldValue('INSTANCE') + ': ' + (volume ? '[Volume - ' + volume + ']' : '') + ': " + ' + text + ');\n';
|
|
306
303
|
}
|
|
307
304
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
return output;
|
|
318
|
-
} else {
|
|
319
|
-
return 'setState("sayit' + dropdown_instance + '.tts.text", "' + (dropdown_language ? dropdown_language + ';' : '') + (value_volume !== null && value_volume !== '' ? '" + ' + value_volume + ' + ";' : '') + '" + ' + value_message + ');\n' + logText;
|
|
320
|
-
}
|
|
321
|
-
};
|
|
305
|
+
const objText = [];
|
|
306
|
+
language && objText.push('language: "' + language + '"');
|
|
307
|
+
text && objText.push('text: ' + text);
|
|
308
|
+
volume && objText.push('volume: ' + volume);
|
|
309
|
+
|
|
310
|
+
return 'sendTo("sayit' + block.getFieldValue('INSTANCE') + '", "say", { ' + objText.join(', ') + ' });' + logText;
|
|
311
|
+
};
|
|
@@ -1,55 +1,94 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
2
|
+
"API Key": "API Schlüssel",
|
|
3
|
+
"API Key is not set!": "API Key ist nicht gesetzt!",
|
|
4
|
+
"API Key:": "API Schlüssel",
|
|
5
|
+
"AWS Region": "AWS Region",
|
|
6
|
+
"AWS Region:": "AWS Region",
|
|
7
|
+
"Access Key": "Zugangs Schlüssel",
|
|
8
|
+
"Access Key:": "Zugangs Schlüssel",
|
|
9
|
+
"Adapter must be enabled": "Adapter muss aktiviert sein",
|
|
10
|
+
"All": "Alle",
|
|
11
|
+
"Announce": "Ankündigung",
|
|
12
|
+
"Announce length": "Ankündigunglänge",
|
|
13
|
+
"Announce length (sec)": "Ansagelänge (Sek.)",
|
|
14
|
+
"Announce length (sec):": "Ankündigunglänge (Sek)",
|
|
15
|
+
"Announce timeout": "Ankündigungstimeout",
|
|
16
|
+
"Announce timeout (sec)": "Zeitüberschreitung ankündigen (Sek.)",
|
|
17
|
+
"Announce timeout (sec):": "Ankündigungstimeout (Sek)",
|
|
18
|
+
"Announce volume": "Ankündigungslautstärke",
|
|
19
|
+
"Announce volume (%)": "Volumen ankündigen (%)",
|
|
20
|
+
"Announce volume (%):": "Ankündigungslautstärke(%)",
|
|
21
|
+
"Announce:": "Ankündigung",
|
|
22
|
+
"Browse": "Durchsuchen",
|
|
23
|
+
"Browser instance": "Browser-Instanz",
|
|
24
|
+
"Browser instance:": "Browser-Instanz",
|
|
25
|
+
"Cache": "Cache benutzen",
|
|
26
|
+
"Cache generated files": "Generierte Dateien zwischenspeichern",
|
|
27
|
+
"Cache-Expiry": "Cache-Ablauf",
|
|
28
|
+
"Cache-Expiry:": "Cache-Ablauf",
|
|
29
|
+
"Cache:": "Cache benutzen",
|
|
30
|
+
"Cloud App Key from iobroker.pro or iobroker.net": "Cloud App Key von iobroker.pro oder iobroker.net",
|
|
31
|
+
"Cloud instance": "Cloud-Instanz",
|
|
32
|
+
"Cloud instance:": "Cloud-Instanz",
|
|
33
|
+
"Device": "Gerät",
|
|
34
|
+
"Device:": "Gerät",
|
|
35
|
+
"Drunk": "Betrunken",
|
|
36
|
+
"Drunk:": "Betrunken",
|
|
37
|
+
"Emotion": "Emotion",
|
|
38
|
+
"Emotion:": "Emotion",
|
|
39
|
+
"Engine": "TTS-Engine",
|
|
40
|
+
"FTP Password": "FTP-Passwort",
|
|
41
|
+
"FTP Port": "FTP-Port",
|
|
42
|
+
"FTP User": "FTP-Benutzer",
|
|
43
|
+
"File": "Datei",
|
|
44
|
+
"Google home server": "Google-Heimserver",
|
|
45
|
+
"IP not accessible for server": "IP ist für dieses Gerät nicht erreichbar",
|
|
46
|
+
"Ignore for non linux OS": "Ignorieren für nicht linux OS",
|
|
47
|
+
"Ill": "Krank",
|
|
48
|
+
"Ill:": "Krank",
|
|
49
|
+
"Install first cloud adapter": "Installieren Sie zuerst den Cloud-Adapter",
|
|
50
|
+
"Language": "Sprache",
|
|
51
|
+
"Language:": "Sprache",
|
|
52
|
+
"Linux player": "Linux-Player",
|
|
53
|
+
"Linux player:": "Linux-Player",
|
|
54
|
+
"Password": "Passwort",
|
|
55
|
+
"Password:": "Passwort",
|
|
56
|
+
"Player": "Abspielen",
|
|
57
|
+
"Port": "Port",
|
|
58
|
+
"Port:": "Port",
|
|
59
|
+
"Robot": "Roboter",
|
|
60
|
+
"Robot:": "Roboter",
|
|
61
|
+
"Secret Key": "Secret Key",
|
|
62
|
+
"Secret Key:": "Secret Key",
|
|
63
|
+
"Server": "Server",
|
|
64
|
+
"Server IP Address": "Server IP-Adresse",
|
|
65
|
+
"Server:": "Server",
|
|
66
|
+
"System command": "Systemkommando",
|
|
67
|
+
"System command:": "Systemkommando",
|
|
68
|
+
"Type": "Ausgabe durch",
|
|
69
|
+
"Type:": "Ausgabe durch",
|
|
70
|
+
"User": "Benutzer",
|
|
71
|
+
"User:": "Benutzer",
|
|
72
|
+
"Vis instances": "Vis-Instanzen",
|
|
73
|
+
"Voice": "Stimme",
|
|
74
|
+
"Voice:": "Stimme",
|
|
75
|
+
"Web instance": "Web instance",
|
|
76
|
+
"Web instance:": "Web instance",
|
|
77
|
+
"Web server IP": "Web server IP",
|
|
78
|
+
"Web server IP:": "Web server IP",
|
|
79
|
+
"error": "Fehler",
|
|
80
|
+
"in % to playing volume": "in % zur Spiellautstärke",
|
|
81
|
+
"in days": "in Tagen",
|
|
82
|
+
"in seconds": "in Sekunden",
|
|
83
|
+
"optional - If player does not work": "optional - Wenn der Player nicht funktioniert",
|
|
84
|
+
"place here": "Dateien hier ablegen",
|
|
85
|
+
"play": "abspielen",
|
|
86
|
+
"sayIt adapter settings": "sayIt Einstellungen",
|
|
87
|
+
"select": "auswählen",
|
|
88
|
+
"tooltip_command": "Dieses Kommando wird ausgeführt, um eigenen System-Player zu benutzen",
|
|
89
|
+
"tooltip_type": "Damit wird gesetzt, wo die Sprache ausgegeben wird",
|
|
90
|
+
"tree": "Baum",
|
|
91
|
+
"vis-2.0 (New)": "vis-2.0 (neu)",
|
|
92
|
+
"vis.0 (deprecated)": "vis.0 (veraltet)",
|
|
93
|
+
"vis.0 and vis-2.0": "vis.0 und vis-2.0"
|
|
94
|
+
}
|