Help us understand the problem. What is going on with this article?

ブラウザからの音声入力を認識してテキスト化する (Web Speech API)

More than 3 years have passed since last update.

Chromeすごいわ。ブラウザだけでここまでできるとは。
こんな簡単なHTMLだけで音声認識→ テキスト化ができます。 日本語もOK。

speech.png

デモをこちらに起きました。
http://inouet.github.io/sample_html/001.speech_recognition.html

コード

<html>
<head>
  <meta charset="UTF-8" />
  <title>Web Speech API</title>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script>
window.SpeechRecognition = window.SpeechRecognition || webkitSpeechRecognition;
var recognition = new webkitSpeechRecognition();
recognition.lang = 'ja';

// 録音終了時トリガー
recognition.addEventListener('result', function(event){
    var text = event.results.item(0).item(0).transcript;
    $("#result_text").val(text);
}, false);

// 録音開始
function record()
{
    recognition.start();
}
</script>
</head>

<body>

<textarea id="result_text" cols="100" rows="10">
</textarea>
<br />
<input type="button" onClick="record()" value="録音開始" />
</body>
</html>

※ ローカルに保存したHTMLをchromeで表示したらうごかず。WEBサーバー経由で表示しないとだめみたい。ハマった。

参考ページ

mercari
フリマアプリ「メルカリ」を、グローバルで開発しています。
https://tech.mercari.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした