Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Speech recognition 如何在输入标签中向网站添加语音识别?_Speech Recognition_Speech To Text - Fatal编程技术网

Speech recognition 如何在输入标签中向网站添加语音识别?

Speech recognition 如何在输入标签中向网站添加语音识别?,speech-recognition,speech-to-text,Speech Recognition,Speech To Text,我想知道如何将语音识别添加到网站中的任何输入标签中。 我已经浏览了很多关于网络的教程,以及所有连演示都没有显示麦克风图标的网站。 我甚至读过文档。请说明是什么造成了这个问题,或者谷歌已经禁用了它? 谢谢这是一种使用html5标记属性在网站中添加语音识别的方法 x-webkit-speech。 您需要在网站中添加的代码如下所示 <p id="msg"> </p> <div id="speech-input"> Enter input ::<inpu

我想知道如何将语音识别添加到网站中的任何输入标签中。 我已经浏览了很多关于网络的教程,以及所有连演示都没有显示麦克风图标的网站。 我甚至读过文档。请说明是什么造成了这个问题,或者谷歌已经禁用了它?
谢谢

这是一种使用html5标记属性在网站中添加语音识别的方法 x-webkit-speech。 您需要在网站中添加的代码如下所示

<p id="msg">
</p>
<div id="speech-input">
    Enter input ::<input type="text" id="text" x-webkit-speech>
</div>

输入:
大多数web浏览器都不支持此输入属性。因此,您可以使用下面的js检查您的站点是否支持此输入属性

var msg = document.getElementById('msg');

if (document.createElement('input').webkitSpeech === undefined) {
msg.innerHTML = "x-webkit-speech is <strong>not supported</strong> in your browser.";
} else {
msg.innerHTML = "x-webkit-speech is <strong>supported</strong> in your browser.";
}
var msg=document.getElementById('msg');
if(document.createElement('input').webkitSpeech==未定义){
msg.innerHTML=“x-webkit-speech在浏览器中不受支持。”;
}否则{
msg.innerHTML=“x-webkit-speech在浏览器中受支持。”;
}

谢谢你,阿杰什,但这对我不起作用。就像我上面提到的,我已经检查了很多教程。请确认上述代码是否在你方有效,或者你可以给我提供一个实例。