         readFile.points = downSampledData.map{CGFloat($0)}
     }
     
-    func readArray( array:[Float]){
+    private func readArray( array:[Float]){
         readFile.arrayFloatValues = array
     }
-    
-    func addDurationOfFileWith(url: URL?) {
-        do {
-            let file = try AVAudioFile(forReading: fileUrl!)
-            let format = AVAudioFormat(commonFormat: .pcmFormatFloat32, sampleRate: file.fileFormat.sampleRate, channels: file.fileFormat.channelCount, interleaved: false)
-            
-            let recAsset = AVAsset(url: fileUrl!)
-            duration = recAsset.duration.seconds
-            
-            let buf = AVAudioPCMBuffer(pcmFormat: format!, frameCapacity: UInt32(file.length))
-            try file.read(into: buf!)
-            readFile.arrayFloatValues = Array(UnsafeBufferPointer(start: buf!.floatChannelData?[0], count:Int(buf!.frameLength)))
-        }catch {
-            print(error)
-        }
-    }
-    
 }

        if readFile.points.count > countOfIntervals {
            interval = Int(readFile.points.count / countOfIntervals)
        }
        for _ in (readFile.points) {
            if i % interval == 0 {
                var x:CGFloat = 2.5
                aPath.move(to: CGPoint(x:aPath.currentPoint.x + x , y:aPath.currentPoint.y))

            i += 1
        }
        
        sonogramColor.set()
        aPath.lineJoinStyle = .round
        aPath.stroke()
        aPath.fill()
        
        let animation2 = CABasicAnimation(keyPath: "strokeColor")
        animation2.duration = 10
        animation2.fromValue = animationFromColor
        animation2.toValue = animationToColor
        
        shapeLayer = CAShapeLayer()
        shapeLayer.add(animation2, forKey: "coloring")
        shapeLayer.strokeColor = shapeColor.cgColor
        shapeLayer.lineJoin = kCALineJoinRound
        shapeLayer.lineWidth = 2
        shapeLayer.frame.size.width = self.frame.width
        shapeLayer.frame.size.height = 30
        shapeLayer.path = (aPath.cgPath)
        clipsToBounds = true
    }
    
    private func convertToPoints() {
        var processingBuffer = [Float](repeating: 0.0,
                                       count: Int(readFile.arrayFloatValues.count))
        let sampleCount = vDSP_Length(readFile.arrayFloatValues.count)
