 
         if state == .Recording {
 
+            AudioBot.stopRecord { [weak self] fileURL, duration, decibelSamples in
+
+                guard duration > YepConfig.AudioRecord.shortestDuration else {
+                    YepAlert.alertSorry(message: NSLocalizedString("Voice recording time is too short!", comment: ""), inViewController: self, withDismissAction: { [weak self] in
+                        self?.state = .Default
+                    })
+                    return
+                }
+
+                let compressedDecibelSamples = AudioBot.compressDecibelSamples(decibelSamples, withSamplingInterval: 1, minNumberOfDecibelSamples: 20, maxNumberOfDecibelSamples: 60)
+                let feedVoice = FeedVoice(fileURL: fileURL, sampleValuesCount: decibelSamples.count, limitedSampleValues: compressedDecibelSamples.map({ CGFloat($0) }))
+                self?.feedVoice = feedVoice
+            }
+
+            /*
             if YepAudioService.sharedManager.audioRecorder?.currentTime < YepConfig.AudioRecord.shortestDuration {
 
                 YepAudioService.sharedManager.endRecord()

        if let audioPlayer = YepAudioService.sharedManager.audioPlayer where audioPlayer.playing {
            audioPlayer.pause()
        }
    }

    // MARK: - Actions

    @IBAction private func cancel(sender: UIBarButtonItem) {

        dismissViewControllerAnimated(true, completion: { [weak self] in

            self?.displayLink?.invalidate()
            self?.playbackTimer?.invalidate()


            }
            
            YepAudioService.sharedManager.endRecord()
             */

        } else {
            proposeToAccess(.Microphone, agreed: {

                do {
                    let decibelSamplePeriodicReport: AudioBot.PeriodicReport = (reportingFrequency: 10, report: { decibelSample in

                        SafeDispatch.async { [weak self] in
                            //self?.waverView.waver.level = CGFloat(decibelSample)
                        }
                    })

                    AudioBot.mixWithOthersWhenRecording = true

                    try AudioBot.startRecordAudioToFileURL(nil, forUsage: .Normal, withDecibelSamplePeriodicReport: decibelSamplePeriodicReport)

                } catch let error {
                    println("record error: \(error)")
                }
                
            }, rejected: { [weak self] in
                self?.alertCanNotAccessMicrophone()
            })
            /*
            let audioFileName = NSUUID().UUIDString
            if let fileURL = NSFileManager.yepMessageAudioURLWithName(audioFileName) {

