             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 {

        }
    }

    // TODO: switch to a synchronous function that paints onto a given context? (for issue #2)
    func plotLogGraph(samples: [CGFloat], maximumValue max: CGFloat, zeroValue min: CGFloat, imageHeight: CGFloat, done: (image: UIImage, selectedImage: UIImage)->Void) {
        let imageSize = CGSizeMake(CGFloat(samples.count), imageHeight)

            scaledProgressWidth = CGFloat(progressSamples - zoomSamples.startIndex) / CGFloat(zoomSamples.count)
        }
        let childFrame = CGRectMake(frame.size.width * scaledX, 0, frame.size.width * scaledWidth, frame.size.height)
        image.frame = childFrame
        highlightedImage.frame = childFrame
        clipping.frame = CGRectMake(0, 0, self.frame.size.width * scaledProgressWidth, self.frame.size.height)
