         amp[1] = 0
     }
 }
+
+public enum AnalysisMode {
+    case rms
+    case peak
+}

public class AmplitudeTap: BaseTap {
    private var amp: [Float] = Array(repeating: 0, count: 2)

    /// Detected amplitude (average of left and right channels
    public var amplitude: Float {
        return amp.reduce(0, +) / 2
    }

    public var rightAmplitude: Float {
        return amp[1]
    }
    
    /// Determines if the returned amplitude value is the rms or peak value
    public var mode: AnalysisMode = .rms

    private var handler: (Float) -> Void = { _ in }

