【问题标题】:Best way to use Speech to text and Text to Speech in Chrome extensions?在 Chrome 扩展中使用 Speech to text 和 Text to Speech 的最佳方式是什么?
【发布时间】:2016-06-19 15:59:20
【问题描述】:

我找到了Text to Speech,但我还需要Speech to text。谷歌有没有什么方法可以提供它或两者都可以使用的替代方法?

【问题讨论】:

标签: javascript google-chrome-extension google-chrome-app text-to-speech speech-to-text


【解决方案1】:

试试SpeechToTextJs

这是我写的纯javascript解决方案,见下面的示例代码

var speecht2text = new SpeechToText(function(){
			speecht2text.setIsContinous(true);
			speecht2text.setAllowInterimResults(true);
			speecht2text.setMaxAlternatives(20);

			var lang = speecht2text.getAllSupportedLanguages();
			speecht2text.setLanguage((lang[0]).key);  // english

			speecht2text.start();

			speecht2text.onEnd(function () {
				alert(speecht2text.getText());
			});

			setTimeout(function(){
				speecht2text.stop();
			},5000);
		},function () {
			alert("Browser Not Supported");
		});
<html>
<head>
	<title></title>
	<script src="https://rawgit.com/imalhasaranga/SpeechToTextJs/master/dist/SpeechToTextJs.min.js"></script>
		
</head>
<body  >
</body>
</html>

【讨论】:

    猜你喜欢
    • 2017-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-23
    • 1970-01-01
    • 1970-01-01
    • 2019-11-14
    相关资源
    最近更新 更多