 
     init() {
 
+        var error : NSError?;
+
+        setupAudioSession()
+
+        engine.connect(engine.mainMixerNode, to: engine.outputNode, format: nil)
+        engine.startAndReturnError(&error)
+
+        if error != nil {
+            println("Error when running engine")
+            println(error)
+        }
+    }
+
+    deinit {
+        engine.stop()
+        stopAudioSession()
     }
 
     public func startRecord(block: CompressedDataClosure) {

        }
    }

}

    var audioPlayer = AVAudioPlayerNode()
    func decodeAndPlay(data: NSData) {
        let buffer = AVAudioPCMBuffer()
        println("Received \(data.length)")
//        audioPlayer.scheduleBuffer(buffer, completionHandler: {})
    }
}

