Open piyuxx opened 3 months ago
我也遇到了同样的问题
use useState instead
const [isSpeaking, setIsSpeaking] = useState(false);
const { loading } = useMicVAD({
onSpeechStart: () => {
// do something when speech start
setIsSpeaking(true);
},
onSpeechEnd: audio => {
// do something when speech start
setIsSpeaking(false);
},
});
I used react, gatsby, typescript and this is the way i implemented \ import { useMicVAD } from "@ricky0123/vad-react"; const a= useMicVAD({ startOnLoad: true, stream, onSpeechStart, onSpeechEnd, positiveSpeechThreshold: 0.6, negativeSpeechThreshold: 0.6 - 0.15, }); and when i log a.userSpeaking it's always false .and here's log { "listening": false, "errored": { "message": "The user aborted a request." }, "loading": false, "userSpeaking": false }