Open SulthanNK opened 8 months ago
implementation project(':@react-native-community_voice') After that also show different error that is below I don't know how to fix this issue If yoou know tell me
same i was also getting error but this library will without any of the manual steps just install it and use it
same i was also getting error but this library will without any of the manual steps just install it and use it
const SpeechStartHandler =() =>{
console.log("speech start handler")
}
const SpeechEndHandler =() =>{
setRecording(false)
console.log("speech End handler")
}
const SpeechResultsHandler =(e) =>{
// const recognizedText = e.value[0];
// console.log("Recognized text:", recognizedText);
console.log('Resulthandler')
setResult("How are you?")
}
const SpeechErrorHandler =(e) =>{
setRecording(false)
console.log("Error handler:", e)
}
const startRecording = async () =>{
setRecording(true)
try{
await Voice.start("en-US") // en-US
}catch(err){
console.log("err", err)
setRecording(false);
}
}
const stopRecording = async () =>{
try{
await Voice.stop()
setRecording(false)
// fetch responce
}catch(err){
console.log("err", err)
}
}
useEffect(()=>{
console.log('use Effect cal')
Voice.onSpeechStart = SpeechStartHandler;
Voice.onSpeechEnd = SpeechEndHandler
Voice.onSpeechResults = SpeechResultsHandler
Voice.onSpeechError = SpeechErrorHandler
return () =>{
// destroy the voice instance
Voice.destroy().then(Voice.removeAllListeners)
console.log('Event listeners removed');
}
},[recording])
I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered
same i was also getting error but this library will without any of the manual steps just install it and use it
const SpeechStartHandler =() =>{ console.log("speech start handler") } const SpeechEndHandler =() =>{ setRecording(false) console.log("speech End handler") } const SpeechResultsHandler =(e) =>{ // const recognizedText = e.value[0]; // console.log("Recognized text:", recognizedText); console.log('Resulthandler') setResult("How are you?") } const SpeechErrorHandler =(e) =>{ setRecording(false) console.log("Error handler:", e) } const startRecording = async () =>{ setRecording(true) try{ await Voice.start("en-US") // en-US }catch(err){ console.log("err", err) setRecording(false); } } const stopRecording = async () =>{ try{ await Voice.stop() setRecording(false) // fetch responce }catch(err){ console.log("err", err) } } useEffect(()=>{ console.log('use Effect cal') Voice.onSpeechStart = SpeechStartHandler; Voice.onSpeechEnd = SpeechEndHandler Voice.onSpeechResults = SpeechResultsHandler Voice.onSpeechError = SpeechErrorHandler return () =>{ // destroy the voice instance Voice.destroy().then(Voice.removeAllListeners) console.log('Event listeners removed'); } },[recording])
I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered
on which device you are testing ur code ?
same i was also getting error but this library will without any of the manual steps just install it and use it
const SpeechStartHandler =() =>{ console.log("speech start handler") } const SpeechEndHandler =() =>{ setRecording(false) console.log("speech End handler") } const SpeechResultsHandler =(e) =>{ // const recognizedText = e.value[0]; // console.log("Recognized text:", recognizedText); console.log('Resulthandler') setResult("How are you?") } const SpeechErrorHandler =(e) =>{ setRecording(false) console.log("Error handler:", e) } const startRecording = async () =>{ setRecording(true) try{ await Voice.start("en-US") // en-US }catch(err){ console.log("err", err) setRecording(false); } } const stopRecording = async () =>{ try{ await Voice.stop() setRecording(false) // fetch responce }catch(err){ console.log("err", err) } } useEffect(()=>{ console.log('use Effect cal') Voice.onSpeechStart = SpeechStartHandler; Voice.onSpeechEnd = SpeechEndHandler Voice.onSpeechResults = SpeechResultsHandler Voice.onSpeechError = SpeechErrorHandler return () =>{ // destroy the voice instance Voice.destroy().then(Voice.removeAllListeners) console.log('Event listeners removed'); } },[recording])
I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered
on which device you are testing ur code ?
Android oppo a54
same i was also getting error but this library will without any of the manual steps just install it and use it
const SpeechStartHandler =() =>{ console.log("speech start handler") } const SpeechEndHandler =() =>{ setRecording(false) console.log("speech End handler") } const SpeechResultsHandler =(e) =>{ // const recognizedText = e.value[0]; // console.log("Recognized text:", recognizedText); console.log('Resulthandler') setResult("How are you?") } const SpeechErrorHandler =(e) =>{ setRecording(false) console.log("Error handler:", e) } const startRecording = async () =>{ setRecording(true) try{ await Voice.start("en-US") // en-US }catch(err){ console.log("err", err) setRecording(false); } } const stopRecording = async () =>{ try{ await Voice.stop() setRecording(false) // fetch responce }catch(err){ console.log("err", err) } } useEffect(()=>{ console.log('use Effect cal') Voice.onSpeechStart = SpeechStartHandler; Voice.onSpeechEnd = SpeechEndHandler Voice.onSpeechResults = SpeechResultsHandler Voice.onSpeechError = SpeechErrorHandler return () =>{ // destroy the voice instance Voice.destroy().then(Voice.removeAllListeners) console.log('Event listeners removed'); } },[recording])
I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered
on which device you are testing ur code ?
Android oppo a54
what android version ?
same i was also getting error but this library will without any of the manual steps just install it and use it
const SpeechStartHandler =() =>{ console.log("speech start handler") } const SpeechEndHandler =() =>{ setRecording(false) console.log("speech End handler") } const SpeechResultsHandler =(e) =>{ // const recognizedText = e.value[0]; // console.log("Recognized text:", recognizedText); console.log('Resulthandler') setResult("How are you?") } const SpeechErrorHandler =(e) =>{ setRecording(false) console.log("Error handler:", e) } const startRecording = async () =>{ setRecording(true) try{ await Voice.start("en-US") // en-US }catch(err){ console.log("err", err) setRecording(false); } } const stopRecording = async () =>{ try{ await Voice.stop() setRecording(false) // fetch responce }catch(err){ console.log("err", err) } } useEffect(()=>{ console.log('use Effect cal') Voice.onSpeechStart = SpeechStartHandler; Voice.onSpeechEnd = SpeechEndHandler Voice.onSpeechResults = SpeechResultsHandler Voice.onSpeechError = SpeechErrorHandler return () =>{ // destroy the voice instance Voice.destroy().then(Voice.removeAllListeners) console.log('Event listeners removed'); } },[recording])
I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered
on which device you are testing ur code ?
Android oppo a54
what android version ?
Android version 11
same i was also getting error but this library will without any of the manual steps just install it and use it
const SpeechStartHandler =() =>{ console.log("speech start handler") } const SpeechEndHandler =() =>{ setRecording(false) console.log("speech End handler") } const SpeechResultsHandler =(e) =>{ // const recognizedText = e.value[0]; // console.log("Recognized text:", recognizedText); console.log('Resulthandler') setResult("How are you?") } const SpeechErrorHandler =(e) =>{ setRecording(false) console.log("Error handler:", e) } const startRecording = async () =>{ setRecording(true) try{ await Voice.start("en-US") // en-US }catch(err){ console.log("err", err) setRecording(false); } } const stopRecording = async () =>{ try{ await Voice.stop() setRecording(false) // fetch responce }catch(err){ console.log("err", err) } } useEffect(()=>{ console.log('use Effect cal') Voice.onSpeechStart = SpeechStartHandler; Voice.onSpeechEnd = SpeechEndHandler Voice.onSpeechResults = SpeechResultsHandler Voice.onSpeechError = SpeechErrorHandler return () =>{ // destroy the voice instance Voice.destroy().then(Voice.removeAllListeners) console.log('Event listeners removed'); } },[recording])
I add With out manual steps but the functions is not call when voice start I try couple of time but function is not triggered
on which device you are testing ur code ?
Android oppo a54
what android version ?
Android version 11
add this in ur manifest file to make it work on android 11
I tried to manually link the package with android base in the readme file documentation and it caused the following build error
Node version: 20.11.0 React native version: both 0.73.3 and 0.72.6 Android version: 11