Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addRecordBackListener not working when passing params in startRecorder function #598

Open
HarshSteyn opened this issue Mar 15, 2024 · 0 comments

Comments

@HarshSteyn
Copy link

The addRecorderBackListener stops working when we pass params in startRecorder function
const onStartRecord = async () => {
const path = 'hello.m4a'; // Set the path for the audio file
const audioSet = {
AudioEncoderAndroid: AudioEncoderAndroidType.AAC,
AudioSourceAndroid: AudioSourceAndroidType.MIC,
AVEncoderAudioQualityKeyIOS: AVEncoderAudioQualityIOSType.high,
AVNumberOfChannelsKeyIOS: 2,
AVFormatIDKeyIOS: AVEncodingOption.aac,
};
const meteringEnabled = true;

const result = await audioRecorderPlayer.startRecorder(
  path,
  audioSet,
  meteringEnabled,
);
audioRecorderPlayer.addRecordBackListener((e) => {
  setRecordSeconds(e.currentPosition);
  setMetering(e.currentMetering);
  // console.log('metering==', e.currentMetering, e.currentPosition);
});
console.log('res==', result, metering, recordSeconds);

};

"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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant