avcapturesession

How can I play a haptic feedback while AvCapture Session is running?

别来无恙 提交于 2021-02-09 11:13:36
问题 When my Avcapture session is running and ready to record a video , I cannot play and audio files, vibrate or play any haptic feedback? I only found a solution for objective c but not swift. Objective C Solution : Using vibrate and AVCaptureSession at the same time 回答1: As long as you are using microphone in the AVCaptureSession , the haptic feedback will not play. Apple tries to prevent the vibration from disrupting the microphone capture. This is noted in https://developer.apple.com

How can I play a haptic feedback while AvCapture Session is running?

孤街醉人 提交于 2021-02-09 11:12:24
问题 When my Avcapture session is running and ready to record a video , I cannot play and audio files, vibrate or play any haptic feedback? I only found a solution for objective c but not swift. Objective C Solution : Using vibrate and AVCaptureSession at the same time 回答1: As long as you are using microphone in the AVCaptureSession , the haptic feedback will not play. Apple tries to prevent the vibration from disrupting the microphone capture. This is noted in https://developer.apple.com

How can I play a haptic feedback while AvCapture Session is running?

末鹿安然 提交于 2021-02-09 11:09:55
问题 When my Avcapture session is running and ready to record a video , I cannot play and audio files, vibrate or play any haptic feedback? I only found a solution for objective c but not swift. Objective C Solution : Using vibrate and AVCaptureSession at the same time 回答1: As long as you are using microphone in the AVCaptureSession , the haptic feedback will not play. Apple tries to prevent the vibration from disrupting the microphone capture. This is noted in https://developer.apple.com

AVFoundation take picture every second SWIFT

泄露秘密 提交于 2021-02-07 10:38:19
问题 I'm trying to use AVFoundation framework to take a picture and analyze it in my app. I want it to take a picture every second automatically, how do I do that? Here is my current code, right now it takes a picture only when call capturePhoto(). func setupSession() { session = AVCaptureSession() session.sessionPreset = AVCaptureSessionPresetPhoto let camera = AVCaptureDevice .defaultDeviceWithMediaType(AVMediaTypeVideo) do { input = try AVCaptureDeviceInput(device: camera) } catch { return }

Recording voice while playing music - filter speakers input (iOS)

纵饮孤独 提交于 2021-01-01 01:29:24
问题 I am developing an Karaoke app in which you can record your voice while listening to the music. When user uses headphones, everything is great - he can listen to the music and himself in headphones while singing. Then we have his pure voice recorded and we can mix it with playback. Problem occurs when user does not use headphones. Then we play music via speakers AVAudioSessionCategoryPlayAndRecord and record simultaneously. In final recording we have user's voice and playback from speakers

Recording voice while playing music - filter speakers input (iOS)

 ̄綄美尐妖づ 提交于 2021-01-01 01:25:35
问题 I am developing an Karaoke app in which you can record your voice while listening to the music. When user uses headphones, everything is great - he can listen to the music and himself in headphones while singing. Then we have his pure voice recorded and we can mix it with playback. Problem occurs when user does not use headphones. Then we play music via speakers AVAudioSessionCategoryPlayAndRecord and record simultaneously. In final recording we have user's voice and playback from speakers

Seamless audio recording while flipping camera, using AVCaptureSession & AVAssetWriter

蓝咒 提交于 2020-11-29 08:30:52
问题 I’m looking for a way to maintain a seamless audio track while flipping between front and back camera. Many apps in the market can do this, one example is SnapChat… Solutions should use AVCaptureSession and AVAssetWriter. Also it should explicitly not use AVMutableComposition since there is a bug between AVMutableComposition and AVCaptureSession ATM. Also, I can't afford post processing time. Currently when I change the video input the audio recording skips and becomes out of sync. I’m

Why my iOS app does not ask user permission to access camera?

只愿长相守 提交于 2020-05-15 04:48:07
问题 I develop iOS app and it uses camera. AVCaptureDeviceInput is used to interface to camera. I checked Authorisation status as - (void)checkDeviceAuthorizationStatus { NSString *mediaType = AVMediaTypeVideo; [AVCaptureDevice requestAccessForMediaType:mediaType completionHandler:^(BOOL granted) { if (granted) { //Granted access to mediaType [self setDeviceAuthorized:YES]; } else { //Not granted access to mediaType dispatch_async(dispatch_get_main_queue(), ^{ [[[UIAlertView alloc] initWithTitle:@

CMSampleBufferGetDataBuffer() returns nil value - Cocoa Swift

家住魔仙堡 提交于 2020-04-30 08:23:06
问题 I am trying to capture my system's screen and process the data. But I get nil value for CMSampleBufferGetDataBuffer for the sample buffer I get in captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) delegate method. Any idea? below is my code: import Cocoa import AVFoundation class ViewController: NSViewController, AVCaptureVideoDataOutputSampleBufferDelegate { private lazy var sampleBufferDelegateQueue = DispatchQueue(label: