gpt4 book ai didi

dart - 如何使用 Dart SpeechSynthesis 类?

转载 作者:行者123 更新时间:2023-12-03 02:58:55 27 4
gpt4 key购买 nike

我无法使用 Dart SpeechSynthesis 类构建 SpeechSynthesis 对象。 Dart 编辑器提示:“类 'SpeechSynthesis' 没有默认构造函数”。

最佳答案

这是一个工作示例:

import 'dart:html';
main() {
var u = new SpeechSynthesisUtterance();
u.text = 'Hello World';
u.lang = 'en-US';
u.rate = 1.2;
window.speechSynthesis.speak(u);
}

the SpeechSynthesis Interface有关 API 的更多详细信息。

关于dart - 如何使用 Dart SpeechSynthesis 类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17357668/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com