I am creating an Expo, react-native application that records your audio as an audio file.
I'm having problems getting the 'metering' property from the RecorderState, which is preventing my implementation of monitoring if a user is speaking or not.
Here is a snippet of my audio recorder & monitoring function:
const audioRecorder = useAudioRecorder(RecordingPresets.HIGH_QUALITY);
const startMonitoring = () => {
if (!isMonitoringRef.current) return;
console.log('Starting monitoring, timestamp:', Date.now());
intervalRef.current = setInterval(async () => {
const metering = audioRecorder.metering ?? -50;
console.log('Metering raw value:', metering, 'isRecording:', audioRecorder.isRecording, 'timestamp:', Date.now()); // Fixed typo
// Silence detection bypassed; stop via mic press
}, 100);
};
Basically, the audio.Recorder.metering is null, although the Recorder successfully records the audio. I know this is true because I am successfully able to transcribe the audio using the audio captured from Recorder.
I know with expo-av, I was able to capture the meter property, but I had to move on from expo-av library due to some other issues with it.
Anyone else have a similar issue and possibly have a fix/advice for it?