         reader.add(readerOutput)
 
         var channelCount = 1
-        let formatDesc: [AnyObject] = assetTrack.formatDescriptions as [AnyObject]
+        let formatDesc = assetTrack.formatDescriptions
         for item in formatDesc {
-            let fmtDesc = CMAudioFormatDescriptionGetStreamBasicDescription(item as! CMAudioFormatDescription)
-            guard fmtDesc != nil else { return }
-            channelCount = Int((fmtDesc?.pointee.mChannelsPerFrame)!)
+            guard type(of: item) == CMAudioFormatDescription.self else { return }
+            guard let fmtDesc = CMAudioFormatDescriptionGetStreamBasicDescription(item as! CMAudioFormatDescription) else { return }    // the forced downcast in here will always succeed
+            channelCount = Int(fmtDesc.pointee.mChannelsPerFrame)
         }
 
         var sampleMax = noiseFloor

// DO SEE http://stackoverflow.com/questions/1191868/uiimageview-scaling-interpolation
// see http://stackoverflow.com/questions/3514066/how-to-tint-a-transparent-png-image-in-iphone

// TODO: find and remove all !

/// A view for rendering audio waveforms
// @IBDesignable
open class FDWaveformView: UIView {

        var scaledWidth: CGFloat = 1.0
        if cachedSampleRange.count > 0 && zoomSamples.count > 0 {
            scaledX = CGFloat(cachedSampleRange.lowerBound - zoomSamples.lowerBound) / CGFloat(zoomSamples.count)
            scaledWidth = CGFloat(cachedSampleRange.last! - zoomSamples.lowerBound) / CGFloat(zoomSamples.count)    // forced unwrap is safe
            scaledProgressWidth = CGFloat(progressSamples - zoomSamples.lowerBound) / CGFloat(zoomSamples.count)
        }
        let childFrame = CGRect(x: frame.width * scaledX, y: 0, width: frame.width * scaledWidth, height: frame.height)
