     public func audioRecorderEncodeErrorDidOccur(recorder: AVAudioRecorder, error: NSError?) {
 
         print("AudioBot audioRecorderEncodeErrorDidOccur: \(error)")
+
+        AudioBot.cleanRecording()
     }
 }
 

    public class func stopRecord(finish: (fileURL: NSURL, duration: NSTimeInterval, decibelSamples: [CGFloat]) -> Void) {

        defer {
            sharedBot.recordingTimer?.invalidate()
            sharedBot.recordingTimer = nil

            sharedBot.recordingPeriodicReport = nil
        }

        guard let audioRecorder = sharedBot.audioRecorder where audioRecorder.recording else {


        sharedBot.recordingPeriodicReport = decibelSamplePeriodicReport

        let timeInterval = 1 / decibelSamplePeriodicReport.reportingFrequency
        let timer = NSTimer.scheduledTimerWithTimeInterval(timeInterval, target: sharedBot, selector: "reportRecordingDecibel:", userInfo: nil, repeats: true)
        sharedBot.recordingTimer?.invalidate()
