|
|
@@ -221,6 +221,18 @@ onMounted(() => {
|
|
|
...history.value[history.value.length - 1],
|
|
|
plot: data.data
|
|
|
}
|
|
|
+ // 创建一个新的SpeechSynthesisUtterance对象
|
|
|
+ var utterance = new SpeechSynthesisUtterance()
|
|
|
+ // 语速
|
|
|
+ utterance.rate = 1.5;
|
|
|
+ // 设置要合成的文本
|
|
|
+ utterance.text = data.data
|
|
|
+
|
|
|
+ // 获取语音合成对象
|
|
|
+ var synth = window.speechSynthesis
|
|
|
+
|
|
|
+ // 添加要合成的文本到队列中
|
|
|
+ synth.speak(utterance)
|
|
|
break
|
|
|
case 'options':
|
|
|
if (history.value[history.value.length - 1].id !== -1) {
|