     // swiftlint:disable force_cast
     private func channelCount(from assetReader: AVAssetReader) -> Int {
         let audioTrack = (assetReader.outputs.first as? AVAssetReaderTrackOutput)?.track
-
         var channelCount = 0
-        audioTrack?.formatDescriptions.forEach { formatDescription in
-            let audioDescription = CFBridgingRetain(formatDescription) as! CMAudioFormatDescription
-            if let basicDescription = CMAudioFormatDescriptionGetStreamBasicDescription(audioDescription) {
+        
+        autoreleasepool {
+            let descriptions = audioTrack?.formatDescriptions as! [CMFormatDescription]
+            descriptions.forEach { formatDescription in
+                guard let basicDescription = CMAudioFormatDescriptionGetStreamBasicDescription(formatDescription) else { return }
                 channelCount = Int(basicDescription.pointee.mChannelsPerFrame)
             }
         }

                    let processedSamples = process(blockSamples,
                                                   ofLength: sampleLength,
                                                   from: assetReader,
                                                   downsampledTo: targetSampleCount)
                    outputSamples += processedSamples
                }
            }

    fileprivate func extract(samplesFrom assetReader: AVAssetReader, downsampledTo targetSampleCount: Int) -> [Float] {
        var outputSamples = [Float]()

        // read upfront to avoid frequent re-calculation (and memory bloat)
        let samplesPerPixel = max(1, sampleCount(from: assetReader) / targetSampleCount)

        assetReader.startReading()
        while assetReader.status == .reading {
            let trackOutput = assetReader.outputs.first!
