Closed tirthasourav closed 4 years ago
Just experienced the same issue but resolved it after adding requesting for runtime permissions. https://reactnativecode.com/react-native-runtime-permissionsandroid/
Assume missing permission. Closing.
You need to check the RECORD_AUDIO
permission before start recording.
try {
const grants = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
);
console.log('record audio', grants);
if (grants === PermissionsAndroid.RESULTS.GRANTED) {
SoundRecorder.start(SoundRecorder.PATH_CACHE + '/test.mp4').then(
function () {
console.log('started recording');
},
);
} else {
console.log('All required permissions not granted')
return;
}
} catch (err) {
console.warn(err);
return;
}
Using react native 0.63.0. Getting 'setAudioSource failed' issue on android on Start recording