             let data = NSMutableData(length: readBufferLength)
             CMBlockBufferCopyDataBytes(readBuffer, 0, readBufferLength, data!.mutableBytes)
             CMSampleBufferInvalidate(readSampleBuffer)
-            let sampleCount = readBufferLength / sizeof(Int16)
+
             let samples = UnsafeMutablePointer<Int16>(data!.mutableBytes)
 
             for i in 0 ..< sampleCount {

        let readerOutput = AVAssetReaderTrackOutput(track: assetTrack, outputSettings: outputSettingsDict)
        readerOutput.alwaysCopiesSampleData = false
        reader.addOutput(readerOutput)
        var channelCount = 1
        let formatDesc: [AnyObject] = assetTrack.formatDescriptions
        for item in formatDesc {

            guard fmtDesc != nil else { return }
            channelCount = Int(fmtDesc.memory.mChannelsPerFrame)
        }

        var sampleMax = noiseFloor
        var samplesPerPixel = channelCount * slice.count / targetSamples
        if samplesPerPixel < 1 {
            samplesPerPixel = 1
        }
