gpt4 book ai didi

javascript - 从语音交互 Canvas 中获取文本?

转载 作者:行者123 更新时间:2023-12-02 21:43:45 25 4
gpt4 key购买 nike

我正在使用 Interactive Canvas 设计一个网页屏幕。我想从用户在输入框中说话的声音中捕获文本。它类似于 functions/index.js 中的 conv.input.raw 但我不知道在 public/index.html 中做什么 enter image description here

最佳答案

一旦你在functions/index.js的conv.input.raw中有文本,你需要使用interactiveCanvas api将它传递到网站。

conv.ask(new HtmlResponse({
data: {
userEnteredData: conv.input.raw
}
}));

从网站上,您将在交互式 Canvas 的回调中获得它

interactiveCanvas.ready({
onUpdate(data) {
console.log('user entered text = ', data.userEnteredData);
document.getElementById("textBox").value = data.userEnteredData;
}
});

关于javascript - 从语音交互 Canvas 中获取文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60312828/

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