avfoundation

What are the BCP-47 voice codes available for iOS 7 AVSpeechSynthesisVoice?

℡╲_俬逩灬. 提交于 2019-12-04 04:02:18
Today I'm very exited about the speech synthesis function is available in iOS7. I want to select the male voice(default in OSX, called alex). I don't know what's the BCP-47 code for him, and BTW how to get the full list of all voice code Here's how to get the BCP-47 codes of the available voices: for (AVSpeechSynthesisVoice *voice in [AVSpeechSynthesisVoice speechVoices]) { NSLog(@"%@", voice.language); } Alex's locale is "English - United States" (en-US), as you can see in the Dictation & Speech control panel on OS X. (Click "Customize..." in the "System Voice" drop down.) iOS 8 added Hebrew,

requestAccessForMediaType doesn't ask for permission

不羁的心 提交于 2019-12-04 04:00:55
问题 I noticed that my app doesn't request permission to use the camera. After some experimentation I figured out that the piece of code used to check permission takes a very long time to complete. So I thought of letting that part of my viewdidload run on a serial queue (sync). Forcing the rest to wait for the auth process to complete before starting the next line. But that doesn't really work. The lines start in order, but still don't finish in order. The strange thing is if I just call for the

Support for background recording of video using AVCaptureSession

二次信任 提交于 2019-12-04 03:46:22
问题 I am trying to record video also in background but currently my code is recording video in foreground when the app goes background the method. -(void)captureOutput:(AVCaptureFileOutput *)captureOutput didFinishRecordingToOutputFileAtURL:(NSURL *)outputFileURL fromConnections:(NSArray *)connections error:(NSError *)error fires immediately with error as error:Error Domain=AVFoundationErrorDomain Code=-11818 "Recording Stopped" UserInfo=0x176aa180 {NSLocalizedRecoverySuggestion=Stop any other

AVFoundation camera preview layer not working

大城市里の小女人 提交于 2019-12-04 03:31:30
问题 So, I am trying to implement a camera using AVFoundation. I think I do everything right. this is what i am doing create session get devices of video type loop through devices to get the camera at the back get a device input using the device mentioned in #3 and add it to the session create an output of type AVCaptureStillImageOutput set output settings and add it to the session get a CALayer from my view 2(will explain below what I mean by view 2) create an instance of

iOS Detect system volume level change. private API or not? AVSystemController_SystemVolumeDidChangeNotification

十年热恋 提交于 2019-12-04 03:06:10
Can listening to AVSystemController_SystemVolumeDidChangeNotification NSNotification be considered (during the App Store review process) as using private API? In my application I need to display and update the current volume level. Volume indicator should be updated after pressing hardware volume buttons and after volume change in MPVolumeView slider. I've searched solution how to get notification or event of hardware volume button press and had found a number of solutions. For example, iPhone Detect Volume Keys press. and How to get audio volume level, and volume changed notifications on iOS?

From UnsafePointer<UnsafePointer<CFloat>> to an array of floats in Swift?

三世轮回 提交于 2019-12-04 02:45:29
I'm trying to access AVAudioPCMBuffer.floatChannelData using Swift but it is of type UnsafePointer<UnsafePointer<CFloat>> (in Objective-C, @property(nonatomic, readonly) float *const *floatChannelData ) and any attempt I make to access it results in execution failed. Sample code to set-up a quick AVAudioPCMBuffer in a Swift Playground is included in a previous question: Getting AVAudioPCMBuffer working (AVAudioFile.mm error code -50) trilorez Does this work? let channels = UnsafeBufferPointer(start: myAudioBuffer.floatChannelData, count: Int(myAudioBuffer.format.channelCount)) let floats =

AVPlayer fails with AVPlayerItemStatusFailed (OSStatus error -12983)

时光总嘲笑我的痴心妄想 提交于 2019-12-04 02:18:20
Sometimes AVPlayer fails with AVPlayerItemStatusFailed and after that failure occurred, AVPlayer continues to failed with AVPlayerItemStatusFailed . I tried to clear the AVPlayer instance and create new one, but I cannot achieve AVPlayerItemStatusFailed failure to solve. Also removingFromSuperview UIView with AVPlayer instance and initializing new item with AVPlayer does not solve the problem. So I figured that out AVPlayer couldn't been cleared completely. Is there anybody suggest anything to try for clearing the AVPlayer completely and make it works after failure? Error log: Error Domain

AVCaptureVideoDataOutput captureOutput not being called

纵然是瞬间 提交于 2019-12-04 01:42:13
问题 I'm trying screen capture on a Mac with AVCaptureScreenInput, but AVCaptureVideoDataOutput delegate captureOutput is never called, and I'm not sure why. I do get a notification saying the capture session was started. import Cocoa import AVFoundation class ViewController: NSViewController, AVCaptureVideoDataOutputSampleBufferDelegate { var captureSession: AVCaptureSession! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } override func

AVfoundation blur background in Video

夙愿已清 提交于 2019-12-04 01:38:04
In my application I have fix composition render size of 1280 x 720. So if will import any portrait video then I have to show blur background with fill and aspect frame of video in centre. Same like this: https://www.youtube.com/watch?v=yCOrqUA0ws4 I achieved to play both videos using AVMtableComposition , but I don't know how to blur a particular background track. I did following in my code: self.composition = [AVMutableComposition composition]; AVAsset *firstAsset = [AVAsset assetWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"ScreenFlow_Blend" ofType:@"mp4"]]]; [self

Transform not working in AVMutableVideoComposition while exporting

自作多情 提交于 2019-12-04 01:33:13
My goal is to compose a set of clips recorded from the camera and export them at a certain preferred size. Of course, the video orientation needs to be rotated before exporting. I'm doing this by composing an AVMutableComposition from an array of video clips, stored in avAssets below. I am able to compose them fine, and export it. However, the rotation transform I am setting on the AVMutableVideoComposition is not being honored. If I use the same transform and set it on the preferredTransform property of the video track, then it works. In both cases, the video renderSize is not being honored.