diff --git a/pages/index.js b/pages/index.js index a35e799..b8afe9c 100644 --- a/pages/index.js +++ b/pages/index.js @@ -8,6 +8,7 @@ import Notice from "../components/notice"; import UploadButton from "../components/uploadButton"; import TagField from "../components/tagField"; import TranscriptField from "../components/transcriptField"; +import {Android} from "@material-ui/icons"; const Home = () => { // 音声認識インスタンス @@ -49,10 +50,13 @@ const Home = () => { recognizerRef.current.lang = "ja-JP"; recognizerRef.current.interimResults = true; recognizerRef.current.continuous = true; + recognizerRef.current.onstart = () => { + setDetecting(true); + }; recognizerRef.current.onend = () => { - if (detecting) { + if (android) { recognizerRef.current.start(); - }; + } }; recognizerRef.current.onresult = event => { [...event.results].slice(event.resultIndex).forEach(result => { @@ -147,35 +151,19 @@ const Home = () => { - + - - - -