AVCaptureMovieFileOutput registra audio solo para el primer video

Estoy desarrollando una aplicación utilizando Swift que grabe el video por una duración precisa. Eso es 7 segundos en este ejemplo. Todos los trabajos son geniales para el primer logging, pero el logging sucesivo no contiene audio sino solo video. Leí algo sobre el cambio de movieFragmentInterval de la instancia AVCaptureMovieFileOutput, bash, pero nada cambia.

func setup(){ self.session = AVCaptureSession() self.session.sessionPreset = AVCaptureSessionPresetHigh // INPUT var devices : Array<AVCaptureDevice> = AVCaptureDevice.devices() as Array<AVCaptureDevice> var camera:AVCaptureDevice! var microphone:AVCaptureDevice! for device in devices{ println("Device name: \(device)") if device.hasTorch && device.isTorchModeSupported(AVCaptureTorchMode.On){ self.torch = device } if device.hasMediaType(AVMediaTypeAudio){ microphone = device } if device.hasMediaType(AVMediaTypeVideo){ if device.position == .Back{ println("Device position: back.") camera = device } } } var error:NSErrorPointer = nil // audio if (microphone != nil){ var audioInput = AVCaptureDeviceInput(device: microphone, error: error) if error == nil{ // if !error{ if self.session.canAddInput(audioInput){ self.session.addInput(audioInput) } } } // video input if (camera != nil){ var VideoInput = AVCaptureDeviceInput(device: camera, error: error) // if !error{ if error == nil{ if self.session.canAddInput(VideoInput){ self.session.addInput(VideoInput) } } } self.output = AVCaptureMovieFileOutput() var prefernetworkingTimeScale:Int32 = 30 var totalSeconds:Int64 = Int64(Int(7) * Int(prefernetworkingTimeScale)) // after 7 sec video recording stop automatically var maxDuration:CMTime = CMTimeMake(totalSeconds, prefernetworkingTimeScale) self.output.maxRecordedDuration = maxDuration self.output.minFreeDiskSpaceLimit = 1024 * 1024 if session.canAddOutput(self.output){ session.addOutput(self.output) } self.connection = self.output.connectionWithMediaType(AVMediaTypeVideo) if self.connection.supportsVideoStabilization == true{ println("video stabilization avaible") self.connection.enablesVideoStabilizationWhenAvailable = true } self.connection.videoOrientation = .LandscapeRight self.session.startRunning() } func startRecording(){ self.output.startRecordingToOutputFileURL(self.tempPathURL, recordingDelegate: self) } func stopRecording(){ self.output.stopRecording() } func captureOutput(captureOutput: AVCaptureFileOutput!, didFinishRecordingToOutputFileAtURL outputFileURL: NSURL!, fromConnections connections: [AnyObject]!, error: NSError!){ println("Finish recording") var success:Bool = false if error != 0 && error != nil{ println("error") let value: AnyObject? = error.userInfo?[AVErrorRecordingSuccessfullyFinishedKey] if value == nil{ success = true }else{ success = false } } if success == true{ stopRecording() } }