 open class AudioRecorderController: UIViewController {
     
     open weak var delegate: AudioRecorderControllerDelegate?
+    open var outputFileType: String = AVFileTypeMPEG4
     
     fileprivate let _navigationController = UINavigationController()
     fileprivate let _controller = _AudioRecorderController()

        stopRecordingTimer()
        if audioRecorder.isRecording {
            audioRecorder.stop()
            composer.merge(trackAt: audioRecorder.url, intoTrackAt: outputURL) {
                [unowned self] url, error in
                if let error = error {
                    switch error {

    }
    
    private var newRecordingURL: URL {
        var fileExtension = ".mp4"
        switch parentController.outputFileType {
        case AVFileTypeMPEG4: fileExtension = ".mp4"
        case AVFileTypeAppleM4A: fileExtension = ".m4a"
        case AVFileTypeAC3: fileExtension = ".ac3"
        case AVFileTypeAMR: fileExtension = ".amr"
        case AVFileTypeAIFC: fileExtension = ".aifc"
        case AVFileTypeAIFF: fileExtension = ".aiff"
        case AVFileTypeMPEGLayer3: fileExtension = ".mp3"
        default: break
        }
        let filename = "\(UUID().uuidString)\(fileExtension)"
        let documentsPath = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first!
        return URL(fileURLWithPath: documentsPath).appendingPathComponent(filename)
    }
