 extension AVAudioPCMBuffer {
 
     public struct Peak {
-        var time: Double = 0
-        var framePosition: Int = 0
-        var amplitude: Float = 1
+        public static var min: Float = -10_000.0
+        public var time: Double = 0
+        public var framePosition: Int = 0
+        public var amplitude: Float = 1
     }
 
     /**

        }

        value.amplitude = peakValue

        AKLog(value)

        return value
    }

    // Returns the highest level in the given array
    private func getPeak(from buffer: [Float]) -> Float {
        // create variable with very small value to hold the peak value
        var peak: Float = -10_000.0

        for i in 0 ..< buffer.count {
            // store the absolute value of the sample


        var value = Peak()
        var position = 0
        var peakValue: Float = Peak.min
        let frameLength = 512
        let channelCount = Int(self.format.channelCount)

