How can i record with swift?

var audioController = AEAudioController(audioDescription: AEAudioController.nonInterleavedFloatStereoAudioDescription(), inputEnabled: true)
var recorder :AERecorder!

@IBAction func startRecording(sender: AnyObject) {
var error: NSErrorPointer
recorder = AERecorder(audioController: self.audioController)

    var format = NSDateFormatter()
    format.dateFormat="yyyy-MM-dd-HH-mm-ss"
    var currentFileName = "-\(format.stringFromDate(NSDate())).aiff"
    //println(currentFileName)

    var dirPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
    var docsDir: AnyObject = dirPaths[0]
    var soundFilePath = docsDir.stringByAppendingPathComponent(currentFileName)

    if !recorder.beginRecordingToFileAtPath(soundFilePath, fileType: kAudioFileAIFFType, error: &error) {

    }
    self.audioController.addInputReceiver(recorder)
    self.audioController.addOutputReceiver(recorder)

}

it give me error in here if !recorder.beginRecordingToFileAtPath(soundFilePath, fileType: kAudioFileAIFFType, error: &error) {

cannot invoke beginRecordingToFileAtPath with an argument list of type :(

Sign In or Register to comment.