avfoundation

AudioKit macOS HelloWorld makes no sound with Bluetooth speaker

杀马特。学长 韩版系。学妹 提交于 2019-12-13 01:16:59
问题 I am running the Hello World example from AudioKit-macOS-4.7.2 using macOS Mojave 10.14.5 on a Mac mini (2018). When running the example using the inbuilt speaker, sound is heard, all is well. When running the example with a UE BOOM 2 bluetooth speaker connected, no sound is heard and I get the following output: 2019-07-12 10:09:19.615436+0100 HelloWorld[1874:44088] [AudioHAL_Client] HALC_ProxyIOContext.cpp:958:IOWorkLoop: HALC_ProxyIOContext::IOWorkLoop: the server failed to start, Error:

capture image is stretched using avcapture session

寵の児 提交于 2019-12-13 00:48:23
问题 I am taking picture using avcaptureSession The images are right below . M i using right approach or is there something wrong? I also change preset but no sucess Here is the image before taking picture output is like that(stretched) My Code is: AVCaptureDeviceInput* input1 = [AVCaptureDeviceInput deviceInputWithDevice:self.device error:nil]; AVCaptureVideoDataOutput* output1 = [[AVCaptureVideoDataOutput alloc] init]; output1.alwaysDiscardsLateVideoFrames = YES; dispatch_queue_t queue; queue =

Swift 3 - Capturing a photo on custom camera view

扶醉桌前 提交于 2019-12-13 00:37:42
问题 I am using Swift 3, Xcode 8.2. A lot of the tutorials that I find on this topic seem to always be in Swift 2. I have a custom camera view already created and I am trying to capture a photo from it. I've set up an @IBAction function below. The variable session_output is AVCapturePhotoOutput : @IBAction func shutterButtonPressed() { session_output.capturePhoto(with: AVCapturePhotoSettings.init(format: [AVVideoCodecKey : AVVideoCodecJPEG]), delegate: <#T##AVCapturePhotoCaptureDelegate#>) } I don

AVAudioPlayer eliminating one second pause between sound files

◇◆丶佛笑我妖孽 提交于 2019-12-13 00:29:05
问题 I am using multiple instances of AVAudioPlayer to play multiple sound files in a succession. I am noticing that there is a roughly one second pause when two different sound files are played. Is it possible to eliminate this one second pause? I call [myPlayer prepareToPlay] for each player ahead of time already. 回答1: According to AVAudioPlayer documentation you could use playAtTime: for synchronized playing. Modified example would look like this: - (void) startSynchronizedPlayback {

iOS - Creating multiple time-delayed live camera preview views

匆匆过客 提交于 2019-12-12 19:30:01
问题 I have done a ton of research, and haven't yet been able to find a viable solution, for many reasons, which I will outline below. Problem In my iOS app, I want three views that indefinitely show a delayed-live preview of the device's camera. For example, view 1 will show a camera view, delayed for 5s, view 2 will show the same camera view, delayed for 20s, and view 3 will show the same camera view, delayed 30s. This would be used to record yourself performing some kind of activity, such as a

Music App (playing in background) breaks while recording video using AVCaptureSession

醉酒当歌 提交于 2019-12-12 17:32:19
问题 I am working on snapchat app like functionality. In my application, music app is running in the background and my app is in foreground state. I have to capture video simultaneously with music app running in the background. Problem :- when my app comes in foreground state, the music app audio break for a second and then continue. Same problem arises when user tap HOME button, app went to background state and the music app audio break for a second. I have downloaded the apple sample code for

drawRect Doesn't want to draw anything

旧城冷巷雨未停 提交于 2019-12-12 17:29:06
问题 I have a ViewController on storyboard. I have used the interface builder to set a toolbar at the bottom of the screen. I have set the custom view to a view overrides drawRect. However, for the life of me, I cannot get anything ever to show up on screen called from that drawRect. drawRect itself is called just fine, but nothing shows up on screen. Also, I have this ViewController with a method that uses AVCaptureSession to toggle its background to a live view from camera input. I had suspected

How To Make UISlider match Audio progress

可紊 提交于 2019-12-12 15:10:24
问题 I am creating a simple music app, and I was wondering how I can make a UiSlider to follow the progress of a audio file. Here's my project so far: Code: import UIKit import AVFoundation class SongDetailViewController: UITableViewController { var audioPlayer = AVAudioPlayer() override func viewDidLoad() { super.viewDidLoad() do { audioPlayer = try AVAudioPlayer(contentsOf: URL.init(fileURLWithPath: Bundle.main.path(forResource: "Song Name", ofType: "mp3")!)) audioPlayer.prepareToPlay() var

How to correctly orient image generated from AVCaptureVideoDataOutputSampleBufferDelegate

≯℡__Kan透↙ 提交于 2019-12-12 14:51:09
问题 I'm using AVCaptureVideoDataOutputSampleBufferDelegate and I receive a CMSampleBufferRef wich I convert to a UIImage - but the resulting image isn't correctly oriented. // Get a CMSampleBuffer's Core Video image buffer for the media data CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); // Lock the base address of the pixel buffer CVPixelBufferLockBaseAddress(imageBuffer, 0); // Get the number of bytes per row for the pixel buffer void *baseAddress =

Occasional blank frames after exporting asset - AVExportSession

醉酒当歌 提交于 2019-12-12 14:37:06
问题 This question has a couple of answers however my condition is a little different and none of the answers solve my problem. Objective I am trying to add a slow motion ramp to a part of my video (in the form of the letter " U " ) which I successfully achieved with the following code : // Description : 1) For a given TimeRange , get the start and end frame. // 2) Divide this TimeRange to 10 segment // 3) Scale each segment with a CMTime that // increments in each iteration of the for loop func