Just doesn't work !What is wrong?
`export default class App extends Component<Props>{ constructor(props) { super(props); Voice.onSpeechStart = this.onSpeechStartHandler.bind(this); Voice.onSpeechEnd = this.onSpeechEndHandler.bind(this); Voice.onSpeechError = this.onSpeechError.bind(this); Voice.onSpeechResults = this.onSpeechResultsHandler.bind(this); this.state = { listening: "pause" }; } onSpeechResultsHandler(result){ console.log("speech result: ",result) } onSpeechStartHandler(){ this.setState({listening:"started"}) console.log("speech started") }
onSpeechEndHandler(){
this.setState({listening:"pause"})
console.log("speech ended")
}
onSpeechError(err){
console.log(err)
}
componentDidMount(){
}
render(){
return (
<View style={styles.container}>
<Text>002</Text>
<Text>react-native-voice Test</Text>
<Button title={this.state.listening} onPress={(e)=>{
console.log("start")
Voice.onSpeechStart = this.onSpeechStartHandler.bind(this);
Voice.start("en-US");
}}/>
</View>
)
}
}` I press the button.Just "start" show in the console.No any listener is triggered!Thanks for any help!
Same here . It doesnt work in iOS device. It works perfectly fine in simulator , but when i run in actual device , its not even asking with the permission popup that usually comes if we are accessing microphone .
@gwl002 you don't need
Voice.onSpeechStart = this.onSpeechStartHandler.bind(this);
Voice.start("en-US");
in Button onPress
try to change that lines to this.onSpeechStartHandler()
and you need button to stop recording to see results I think
@siarhei-zharnasek Did you solve your problem?
@siarhei-zharnasek Did you solve your problem?
I didn't have it, just wanted to help :)
Same here. Still have no idea; no callback is invoked.
is this ever getting resolved or what? still same issue