     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 }
 

        for n in 0 ..< channelCount {
            let data = floatData[n]

            var rms: Float = 0
            vDSP_rmsqv(data, 1, &rms, UInt(length))
            amp[n] = rms
        }

        handler(amplitude)

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
    }
