-
Notifications
You must be signed in to change notification settings - Fork 537
App crashes when microphone is in use by a third party application #261
Description
Version
Tell us which versions you are using ( you can see the versions in your package.json ):
react-native-audio : "^4.1.3"
react-native : "0.55.4"
react : "16.4.1"
using react-native-sound ? Yes (however not relevant for this issue)
Expected behaviour :
What were you trying to do and what did you expect to happen ?
`
Recording audio on Android when resources are locked (i.e.: during WhatsApp/Skype call) requires INTERACT_ACROSS_USERS_FULL permission which is supposedly a system permission. Expected to throw an exception to be handled by user.
Actual behaviour
What happened when your issue occurred ? The more details you provide here the better the odds are that someone will help you resolve your issue
Host app throws an unhandled exception at runtime and crashes.
Steps to reproduce
Please provide us with some code that we can run to reproduce your error.
- import audio library
import {AudioRecorder, AudioUtils} from 'react-native-audio';
- prepare audio recording
prepareRecordingPath(audioPath) {
AudioRecorder.prepareRecordingAtPath(audioPath, {
SampleRate: 22050,
Channels: 1,
AudioQuality: "Low",
AudioEncoding: "aac",
AudioEncodingBitRate: 32000
});
}
- record audio
try {
const filePath = await AudioRecorder.startRecording();
} catch (error) {
console.error(error);
}
- Run the code above during a WhatsApp/Skype call (or any third party using the microphone).
Link to a git repo that reproduces bug
react-native-audio example
You may reproduce following the steps above on the library's example
If you put a GitHub repo that reproduces your issue then you significantly increase your chances of getting help !