         var tapeForReading: AKAudioFile
         do {
             tapeForReading = try AKAudioFile(readAVAudioFile: tape)
-             return tapeForReading
+            return tapeForReading
         } catch let error as NSError {
             print ("Cannot create readingTape")
             print ("Error: \(error.localizedDescription)")
             return nil
         }
-
-    }
-
+        
+    }
+    
 }
            return
        }

        if  node != nil {
            recording = true

            print ("recording")
            node!.avAudioNode.installTapOnBus(0, bufferSize: bufferSize, format: tape.processingFormat, block: { (buffer: AVAudioPCMBuffer!, time: AVAudioTime!) -> Void in
                do {

    private var bufferSize: AVAudioFrameCount
    private var recording = false


    private let previousAVAudioSessionCategory: String?

    public init(node: AKNode = AudioKit.output!, file: AKAudioFile? = nil, buffer bufferSize: UInt32 = 1024  ) throws {


        // requestRecordPermission...
        var permissionGranted: Bool = false
        #if os(iOS)

            self.previousAVAudioSessionCategory = AVAudioSession.sharedInstance().category

            AVAudioSession.sharedInstance().requestRecordPermission({(granted: Bool)-> Void in
                if granted {
                    permissionGranted = true
                } else {
                    permissionGranted = false
                }
            })

            if !permissionGranted {
                print("AKNodeRecorder Error: Permission to record not granted")
                throw NSError(domain: NSURLErrorDomain, code: NSURLErrorUnknown, userInfo: nil)
            }
        #endif

        // AVAudioSession buffer setup

        self.bufferSize = bufferSize
        if file == nil {
            // We create a record file in temp directory
            do {
