Open rsys-harsh-saini opened 8 months ago
What android version are you using in the simulator?
iOS callback addRecordBackListener not working too when use path prop.
Example success work:
const result = await audioRecorderPlayer.current.startRecorder()
{"e": {"currentMetering": 0, "currentPosition": 529.297052154195, "isRecording": true}, "state": {"recordSecs": 529.297052154195, "recordTime": "00:00:52"}}
Not working:
const uri = `${RNFS.CachesDirectoryPath}/sound.aac`
const result = await audioRecorderPlayer.current.startRecorder(uri)
// const result = await audioRecorderPlayer.current.startRecorder(uri, audioSet)
May be problem is directory path, if use only name it work, https://github.com/hyochan/react-native-audio-recorder-player/blob/2816abab9b049b104ff29b2c8ac1792a8e19822b/ios/RNAudioRecorderPlayer.swift#L46
const result = await audioRecorderPlayer.current.startRecorder(
'sound.aac',
audioSet,
meteringEnabled,
)
iOS callback addRecordBackListener not working too when use path prop.
Example success work:
const result = await audioRecorderPlayer.current.startRecorder() {"e": {"currentMetering": 0, "currentPosition": 529.297052154195, "isRecording": true}, "state": {"recordSecs": 529.297052154195, "recordTime": "00:00:52"}}
Not working:
const uri = `${RNFS.CachesDirectoryPath}/sound.aac` const result = await audioRecorderPlayer.current.startRecorder(uri) // const result = await audioRecorderPlayer.current.startRecorder(uri, audioSet)
May be problem is directory path, if use only name it work,
const result = await audioRecorderPlayer.current.startRecorder( 'sound.aac', audioSet, meteringEnabled, )
Thank you for your solution. This worked perfectly.
In Android Version > 12 you can't ask for external storage permissions only record audio. So if you put a path in the startRecorder() this wouldn't work.
};
"react-native-audio-recorder-player": "^3.6.6",
"react-native": "^0.72.7",
issue on both platforms
the console log statement in the listener should work
the console log statement in the listener doesnt work