恐咖兵糖的微博客实例

微语

恐咖兵糖 . @kkbt,

手动转帖 @mashiro @hello.2heng.xin

const synth = window.speechSynthesis;

export const textToSpeech = (message: string) => {
  const msg = new SpeechSynthesisUtterance();

  msg.lang = 'zh-CN';
  msg.text = message;
  synth.speak(msg);
};

textToSpeech('我去你大爷');
const synth = window.speechSynthesis;

const textToSpeech = (message) => {
  const msg = new SpeechSynthesisUtterance();

  msg.lang = 'zh-HK';
  msg.text = message;
  synth.speak(msg);
};

textToSpeech('扑街仔');
Open thread
在 超光速-月下微语 查看