react-native-voice / voice

:microphone: React Native Voice Recognition library for iOS and Android (Online and Offline Support)
MIT License
1.81k stars 485 forks source link

Unhandled exception when another application is using the microphone #154

Open eoinnorris opened 5 years ago

eoinnorris commented 5 years ago

There is an unhandled exception when a user uses the voice recognition while a call is going on, or in fact where there are any other users of the microphone. Im not sure what the exception is exactly as the exception isn't specifically explained in the external reports I get. Ill try and fix this myself if I can.

To reproduce:

1 ) build an app with Voice 2) Start a phone call. 3) Use the Voice start call 4) Theres an exception below the Objective C level but it could be handled at the Objective C level.

0 (null) in __exceptionPreprocess ()

1 (null) in objc_exception_throw ()

2 (null) in +[NSException raise:format:arguments:] ()

3 (null) in AVAE_RaiseException(NSString*, ...) ()

4 (null) in _AVAE_Check(char const, int, char const, char const*, bool) ()

5 (null) in AUGraphNodeBaseV3::CreateRecordingTap(unsigned long, unsigned int, AVAudioFormat*, void (AVAudioP... ()

6 (null) in AVAudioEngineGraph::InstallTapOnNode(AVAudioNode, unsigned long, unsigned int, AVAudioFormat, v... ()

7 (null) in AVAudioEngineImpl::InstallTapOnNode(AVAudioNode, unsigned long, unsigned int, AVAudioFormat, vo... ()

8 (null) in -[AVAudioNode installTapOnBus:bufferSize:format:block:] ()

9 (null) in -[Voice setupAndStartRecognizing:] ()

10 (null) in __TCCAccessRequest_block_invoke.77 ()

11 (null) in __tccd_send_message_block_invoke ()

12 (null) in _xpc_connection_reply_callout ()

13 (null) in _xpc_connection_call_reply_async ()

14 (null) in _dispatch_client_callout3 ()

15 (null) in _dispatch_mach_msg_async_reply_invoke$VARIANT$armv81 ()

16 (null) in _dispatch_kevent_worker_thread ()

17 (null) in _pthread_wqthread ()

18 (null) in start_wqthread ()

breadadams commented 5 years ago

Yep I can confirm this is happening in our app using the react-native-voice lib @wenkesj.

Strange, as it captures voice correctly when you're screen recording with mic. activated. Maybe a security feature of iOS (to prevent call recording) that isn't being handled somewhere in the library? 🤷‍♂️

aesnguyen commented 5 years ago

I have the same problem when I want to speech recoginition in a meeting room. Are there any solution, sir?

lfoliveir4 commented 4 years ago

@eoinnorris Did you solved your problem?