     ///   - duration: The duration in seconds of the clip to record, will be adjusted if start time
     /// was adjusted.
     ///   - tap: An optional tap to access audio as it's being recorded.
-    ///   - completion: A closure that will be called when the clip is finished recording. If
-    /// successful URL will be non-nil. If recording failed, Error will be non nil.  The actual
-    /// start time is included and should be checked in case it was adjusted.
+    ///   - completion: A closure that will be called when the clip is finished recording. time and duration may be different in the result.
     ///
     public func recordClip(time: Double = 0,
                            duration: Double = Double.greatestFiniteMagnitude,
                            tap: AVAudioNodeTapBlock? = nil,
-                           completion: @escaping AKRecordingResult) throws {
+                           completion: @escaping ClipRecordingCompletion) throws {
 
         guard time >= 0, duration > 0, time + duration > timing.currentTime else {
             throw ClipRecordingError.invalidParameters

        if clip.audioTimeStart != nil,
            let audioFile = clip.audioFile,
            audioFile.length > 0 {
            clip.audioFile = nil
            clip.completion(url, clip.startTime, error)
            completion?()
        } else {
            clip.completion(nil, 0, error ?? ClipRecordingError.timingError)
            completion?()
        }
        if FileManager.default.fileExists(atPath: url.path) {

    var endTime: Double
    var audioTimeStart: AVAudioTime?
    var audioFile: AKAudioFile?
    var completion: ClipRecordingCompletion
    var tap: AVAudioNodeTapBlock?
    init(start: Double = 0,
         end: Double = Double.greatestFiniteMagnitude,
         audioFile: AKAudioFile? = nil,
         completion: @escaping ClipRecordingCompletion) {

        startTime = start
        endTime = end
        var called = false
        self.completion = { result in
            if called {
                return
            }
            called = true
            completion(result)
        }
        self.audioFile = audioFile
    }
