I'm working on a Next.js project and trying to use react-speech-recognition. It works well on Chrome Desktop, but it doesn't work on Chrome Android. I also tried the push-to-talk method, but it still didn't work. Is it possible to use react-speech-recognition on Chrome Mobile? I want to create a PWA.
"use client";
import React, { useEffect } from "react";
import SpeechRecognition, {
useSpeechRecognition,
} from "react-speech-recognition";
export default function page() {
const {
transcript,
listening,
resetTranscript,
browserSupportsSpeechRecognition,
} = useSpeechRecognition();
if (!browserSupportsSpeechRecognition) {
return <span>Browser doesn not support speech recognition.</span>;
}
useEffect(() => {
SpeechRecognition.startListening({
continuous: true,
interimResults: true,
language: "id-ID",
});
}, []);
return (
<div className='w-full h-screen bg-finic flex flex-col items-center justify-center'>
<div className='flex flex-col items-center justify-center h-fit px-[30px]'>
<h1 className='font-clash font-[700] text-xl text-center text-finblack mt-16'>
{transcript}
</h1>
</div>
</div>
);
}