voice icon indicating copy to clipboard operation
voice copied to clipboard

Just doesn't work !What is wrong?

Open gwl002 opened this issue 7 years ago • 6 comments

`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!

gwl002 avatar Mar 30 '18 08:03 gwl002

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 .

shrinandhini2801 avatar May 09 '18 13:05 shrinandhini2801

@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 avatar Sep 10 '18 14:09 siarhei-zharnasek

@siarhei-zharnasek Did you solve your problem?

lfoliveir4 avatar Dec 16 '19 12:12 lfoliveir4

@siarhei-zharnasek Did you solve your problem?

I didn't have it, just wanted to help :)

js-cowboy avatar Dec 17 '19 06:12 js-cowboy

Same here. Still have no idea; no callback is invoked.

ChampionRoy avatar May 17 '20 07:05 ChampionRoy

is this ever getting resolved or what? still same issue

AjeetCoditude avatar Mar 28 '25 19:03 AjeetCoditude