muhaos / react-native-speech-to-text-ios

React Native speech recognition component for iOS 10+
MIT License
40 stars 9 forks source link

AVSpeechSynthesizer does not speak after using SFSpeechRecognizer #5

Closed pratomchaip closed 7 years ago

pratomchaip commented 7 years ago

When the SFSpeechRecognizer is turn on in setupAndStartRecognizing(), it sets the audioSession category to AVAudioSessionCategoryRecord audioSession setCategory:AVAudioSessionCategoryRecord

... but when the SpeechRecogniser is turned off in teardown(), the audioSession is not reset to play because it is left in Recording mode.

Possible solution is to reset the audioSession.setCategory to AVAudioSessionCategoryPlayback in the teardown() method.

I'm not an Objective-C/Swift developer so I can't do it myself.

... is that possible to implement in the next update?

martinblampied commented 7 years ago

Yes, the teardown is missing self.audioSession = nil;

JoseIgnacio92 commented 7 years ago

It happens to me when the result returns. My application stops having audio because something is still not closed.

Any solution?

martinblampied commented 7 years ago

Fixed in https://github.com/muhaos/react-native-speech-to-text-ios/pull/12/commits/82adad8d23a43c277f51f98f8f0933f9a6656ba9