shikeying
2023-04-25 0b67fd879ccd4fb6319dc016babd3bb8ea79dff0
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;