-
Notifications
You must be signed in to change notification settings - Fork 1
/
MMM-Text-To-Speech.js
56 lines (47 loc) · 1.32 KB
/
MMM-Text-To-Speech.js
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
56
/* global Module */
/* Magic Mirror
* Module: MMM-Text-To-Speech
*
* By Krzysztof Błachowicz
* MIT Licensed.
*/
Module.register("MMM-Text-To-Speech", {
defaults: {
language: "en",
speed: 1,
soundModuleDir: "MMM-Sounds",
mqttServer: {}
},
requiresVersion: "2.1.0", // Required version of MagicMirror
start: function () {
Log.info("Starting module: " + this.name);
this.sendSocketNotification("CONFIG", this.config);
},
getScripts: function () {
return [];
},
getStyles: function () {
return ["MMM-Text-To-Speech.css"];
},
// Load translations files
getTranslations: function () {
return {
en: "translations/en.json",
es: "translations/es.json",
};
},
notificationReceived: function (notification, payload, sender) {
if (
notification === "MMM-Text-To-Speech" ||
notification === "MMM-TTS"
) {
this.sendSocketNotification("MMM-Text-To-Speech", payload);
}
},
// socketNotificationReceived from helper
socketNotificationReceived: function (notification, payload) {
if (notification === "MMM-Text-To-Speech-PLAY_SOUND") {
this.sendNotification("PLAY_SOUND", payload);
}
}
});