Modifying expo-av EXAV file to handle audio metering

Hi I have forked the expo/expo repo from github and have begun to modify some of the code in expo-av package to better handle support for audio metering as I haven’t found a way to do so via the currently exposed methods.

I’ve modified the EXAV.m file to include these lines

- (NSDictionary *)_getAudioRecorderStatus
  if (_audioRecorder) {
    int durationMillisFromRecorder = [self _getDurationMillisOfRecordingAudioRecorder];
    // After stop, the recorder's duration goes to zero, so we replace it with the correct duration in this case.
    int durationMillis = durationMillisFromRecorder == 0 ? _audioRecorderDurationMillis : durationMillisFromRecorder;

    float currentPeakMetering = [_audioRecorder peakPowerForChannel: 0];
    float currentMetering = [_audioRecorder averagePowerForChannel: 0];

    return @{@"canRecord": @(YES),
             @"isRecording": @([_audioRecorder isRecording]),
             @"durationMillis": @(durationMillis),
             @"currentMetering": @(currentMetering),
             @"currentPeakMetering": @(currentPeakMetering)};
  } else {
    return nil;

and in the src/Audio/Recording.ts file i’ve modified the returned value to

export type RecordingStatus = {
  canRecord: boolean;
  isRecording: boolean;
  isDoneRecording: boolean;
  durationMillis: number;
  currentMetering: number;
  currentPeakMetering: number;

to handle the new metered values

I’m able to get the typescript portions to compile successfully and I can open the expo-bare project in xcode and see the modified file in the EXAV development pod but I cannot figure out how to get it to compile to a binary to serve to the application i’m writing to fully test if it was correctly configured.

I’ve followed the instructions here expo/ at master · expo/expo · GitHub but I cannot figure out how to compile the objective c code down correctly