-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtts.js
73 lines (53 loc) · 1.56 KB
/
tts.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const googleTTS = require('google-tts-api');
const {zokou} = require("../framework/zokou");
zokou( {
nomCom : "dit",
categorie : "tts",
reaction : "👄" },
async(dest,zk, commandeOptions)=> {
const {ms,arg,repondre} = commandeOptions;
if (!arg[0]) {repondre("Insert a word");return} ;
const mots = arg.join(" ")
const url = googleTTS.getAudioUrl( mots, {
lang: 'fr',
slow: false,
host: 'https://translate.google.com',
});
console.log(url);
zk.sendMessage(dest, { audio: { url:url},mimetype:'audio/mp4' }, { quoted: ms,ptt: true });
}
) ;
zokou( {
nomCom : "itta",
categorie : "tts",
reaction : "👄" },
async(dest,zk, commandeOptions)=> {
const {ms,arg,repondre} = commandeOptions;
if (!arg[0]) {repondre("Insert a word");return} ;
const mots = arg.join(" ")
const url = googleTTS.getAudioUrl( mots, {
lang: 'ja',
slow: false,
host: 'https://translate.google.com',
});
console.log(url);
zk.sendMessage(dest, { audio: { url:url},mimetype:'audio/mp4' }, { quoted: ms,ptt: true });
}
) ;
zokou( {
nomCom : "say",
categorie : "tts",
reaction : "👄" },
async(dest,zk, commandeOptions)=> {
const {ms,arg,repondre} = commandeOptions;
if (!arg[0]) {repondre("Insert a word");return} ;
const mots = arg.join(" ")
const url = googleTTS.getAudioUrl( mots, {
lang: 'en',
slow: false,
host: 'https://translate.google.com',
});
console.log(url);
zk.sendMessage(dest, { audio: { url:url},mimetype:'audio/mp4' }, { quoted: ms,ptt: true });
}
) ;