Please fill the template to help you out. Also, please try the Example project compare before submiting the issue when you have certain issue with your project setup.
Version of react-native-audio-recorder-player
"react-native-audio-recorder-player": "^3.1.1"
Version of React Native
"react-native": "0.64.2",
Platforms you faced the error (IOS or Android or both?)
Both-IOS and Android
Expected behavior
The method should be giving the current time in mm:ss format
Actual behavior
The method is giving aN:aN
Steps to reproduce the behabior
create a react native project
install react-native-audio-player
create a button for start record
create a state :
const [recordTime, setRecordTime] = useState("00:00");
onstartRecord for the button method is as follows:
Version of react-native-audio-recorder-player
"react-native-audio-recorder-player": "^3.1.1"
Version of React Native
"react-native": "0.64.2",
Platforms you faced the error (IOS or Android or both?)
Both-IOS and Android
Expected behavior
The method should be giving the current time in mm:ss format
Actual behavior
The method is giving aN:aN
Steps to reproduce the behabior
create a react native project install react-native-audio-player create a button for start record create a state : const [recordTime, setRecordTime] = useState("00:00");
onstartRecord for the button method is as follows:
const onStartRecord = async (isFromRecordButton) => { console.log('ggg') try { if (isFromRecordButton) { } else { setrecordingfile(false); } console.log('hh') let iswritestoragegranted = await writetoexternalstorage(); let isrecordgranted = await recordaudiopermission(); if(Platform.OS=="android"){ if (iswritestoragegranted && isrecordgranted) { setrecording(true); isRecordFileExists = true; // const path = Platform.select({ // ios: "hello.m4a", // android: "sdcard/hello.mp4", // }); const result = await audioRecorderPlayer.startRecorder(mRecordTrack); audioRecorderPlayer.addRecordBackListener((e) => { console.log('EEEE',audioRecorderPlayer.mmss(e.current_position)); setRecordTime( audioRecorderPlayer.mmss(Math.floor(e.current_position)) ); // console.log("Recording . . . ", e.current_position); // console.log("file...", e); return; }); console.log(result); } }else{ console.log('jjjj') setrecording(true); isRecordFileExists = true; // const path = Platform.select({ // ios: "hello.m4a", // android: "sdcard/hello.mp4", // }); const result = await audioRecorderPlayer.startRecorder(mRecordTrack);
};