Chromeなら一行で音声認識を実装できる

Chromeで簡単に音声認識を実装できるようなので試してみました。
プレビュー
アイコンをクリックしてマイクに話しかけてみてください。
ポイント
x-webkit-speech
を追加するだけ。
ソースコード
html
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title></title> </head> <body> <div id="container"> <form> <input type="text" x-webkit-speech placeholder="キーワード"> </form> </div><!-- #container --> </body> </html>
css
@charset "utf-8"; body { background:#7f9b4e url() no-repeat center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; } #container { width: 100%; margin: 0 auto; position: relative; } form { width: 220px; margin: 200px auto; position: relative; } input { font-size:20px; }