1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
| import Speech from 'speak-tts'
|
| class SpeechObject {
|
| constructor() {
| this.speech = new Speech();
| this.speech.setLanguage("zh-CN");
| this.speech.init().then(() => {console.log("tts......")});
| }
|
| speak(message){
| this.speech.speak({ text: message }).then(() => {
| console.log("tts成功");
| });
| }
| }
|
| export default SpeechObject;
|
|