shikeying
2023-04-19 529f48641122af7c0aec185e4283d02e97aa0f89
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;