                            samplesToProcess: samplesToProcess,
                            downSampledLength: downSampledLength,
                            samplesPerPixel: samplesPerPixel,
-                           filter2: filter)
+                           filter: filter)
         }
         
         // if (reader.status == AVAssetReaderStatusFailed || reader.status == AVAssetReaderStatusUnknown)

            
            totalSampleCount += readBufferLength / 2

//            let samplesPerPixel: Int
//            if sampleRemainderBucketCount > sampleRemainder {
//                samplesPerPixel = 44
//            }
//            else {
//                samplesPerPixel = 45
//            }
            
            let totalSamples = sampleBuffer.count / MemoryLayout<Int16>.size
           
//            let downSampledLength = totalSamples / samplesPerPixel
//            let samplesToProcess = downSampledLength * samplesPerPixel

            let (samplesToProcess, downSampledLength) = test(totalCurrentSamples: totalSamples,
                                                             lowerSamplesPerPixel: lowerSamplesPerPixel,
                                                             remainder: sampleRemainder,
                                                             currentRemained: &sampleRemainderBucketCount)
            let samplesPerPixel = samplesToProcess / downSampledLength
//            sampleRemainderBucketCount += downSampledLength
            
            guard samplesToProcess > 0 else { continue }
            
            processSamples(fromData: &sampleBuffer,

            return
        }
        
        let targetSamples = Int(imageSize.width * format.scale)
        
        let image: UIImage? = {
            guard
                let (samples, sampleMax) = sliceAsset(withRange: sampleRange, andDownsampleTo: targetSamples),
                let image = plotLogGraph(samples, maximumValue: sampleMax, zeroValue: self.format.noiseFloor)
            else { return nil }
            
