 
     let dB = recorder.averagePowerForChannel(0)
 
-    delegate?.audioMeterDidUpdate(dB)
+    delegate?.audioMeterDidUpdate?(dB)
   }
 
   private func startMetering() {


    recorder.prepareToRecord()
    recorder.delegate = delegate
    recorder.meteringEnabled = meteringEnabled
  }

  public func record() throws {

import QuartzCore

@objc public protocol RecorderDelegate: AVAudioRecorderDelegate {
  optional func audioMeterDidUpdate(dB: Float)
}

public class Recording : NSObject {
