Post not yet marked as solved
I'm trying to use AVAudioEngine to record sounds from the microphone together with various sound effect files to a AVAudioFile.I create an AVAudioFile like this:let settings = self.engine.mainMixerNode.outputFormatForBus(0).settingstry self.audioFile = AVAudioFile(forWriting: self.audioURL, settings: settings, commonFormat: .PCMFormatFloat32, interleaved: false)I install a tap on the audio engine's mainMixerNode, where I write the buffer to the file:self.engine.mainMixerNode.installTapOnBus(0, bufferSize: 4096, format: self.engine.mainMixerNode.outputFormatForBus(0)) { (buffer, time) -> Void in do { try self.audioFile?.writeFromBuffer(buffer) } catch let error as NSError { NSLog("Error writing %@", error.localizedDescription) }}I'm using self.engine.mainMixerNode.outputFormatForBus(0).settingswhen creating the audio file since Apple states that "The buffer format MUST match the file's processing format which is why outputFormatForBus: was used when creating the AVAudioFile object above". In the documentation for installTapOnBus they also say this: " The tap and connection formats (if non-nil) on the specified bus should be identical"However, this gives me a very large, uncompressed audio file. I want to save the file as .m4a but don't understand where to specify the settings I want to use:[AVFormatIDKey: NSNumber(unsignedInt: kAudioFormatMPEG4AAC),AVSampleRateKey : NSNumber(double: 32000.0),AVNumberOfChannelsKey: NSNumber(int: 1),AVEncoderBitRatePerChannelKey: NSNumber(int: 16),AVEncoderAudioQualityKey: NSNumber(int: Int32(AVAudioQuality.High.rawValue))]If I pass in these settings instead when creating the audio file, the app crashes when I record.Any suggestions or ideas on how to solve this?
Post not yet marked as solved
I'm using AVAudioEngine to record input from the microphone as well as various sound effects to a single file.My AVAudioEngine graph looks like this:soundfileNode ----> mainMixer ---> outputNode (speaker)
|
| (AVAudioConnectionPoint)
v
inputNode (mic) --> secondaryMixer ---> tap (write to file)I'm splitting the output from my mainMixer using AVAudioConnectionPoints to make it output audio to a secondaryMixer and to the speaker. I'm doing this so that only the sound from the sound file nodes are played back through the speaker while recording, as I don't want the mic input to be heard during recording.The error occurs when the output from the mainMixer is written to an audio file using a tap I have installed on the secondaryMixer. The recorded sound "stutters" - there is a very short silence - or gap - about 3 times every second, which probably occurs every time my tap closure is called. It's as if not the entire buffer is written to the output file. The sound from the mic is written to the file exactly as it should, with no gaps, so the problem seems to be the AVAudioConnectionPoint from the mainMixer to the secondaryMixer, which isn't in complete sync or drops parts of the buffer.Has anyone else experienced this problem?
Post not yet marked as solved
Since upgrading to XCode 10 my iOS simulators have become really slow. There's a lot of lag when scrolling in tableviews or scrollviews. Is anyone else having this problem?
Post not yet marked as solved
My company develops a service targeted at businesses. It's basically an service where employees and other invited persons can collaborate. There's a free tier with a maximum number of users the business can add. However, they can also choose to upgrade their account. Purchasing a subscription will unlock the ability to add even more users. This can be done on the website. However, we also have an iOS app with the same functionality as the website, sans the option to upgrade the account.We have been thinking about adding this functionality to the app as well, but haven't been able to figure out if this means that we will have to use in-app purchases for this or if we can implement our own payment solution. Can anyone shed some light on this? I have read the guidelines, but they don't appear to answer my question...- Subscriptions aren't personal, i.e. they are not purchased by individual users, but are associated with the organization the user belongs to- We don't unlock any additional functionality or features. The only difference between the different tiers is the number of users allowed in the organization
Post not yet marked as solved
I don't know if I have an error in my code, but it seems applying formatting to a text in a UITextView using the default bold and italics buttons are kind of buggy in iOS11. If I tap the bold button and then type text, only the first letter is bold and then it reverts to the regular font weight. If I select the entire text and make it bold, the oppsite occurs - if I place the cursor at the end of the text and tap the bold button (to turn it off) to enter regular text, only the first letter I enter has the regular weight - all characters I enter afterwards appear in bold and the button revert to its "on" state.If I do this in iOS10, everthing works as intended however.Has anything changed in iOS11 that I don't know about, or is this a bug?
Post not yet marked as solved
For some reason, if I get an exception when running an app in the iOS 11 simulator I don't get a call stack and no row is highlighted, which makes it hard to find the reason for the crash...I just get this:Thread 1: signal SIGABRTlibc++abi.dylib: terminating with uncaught exception of type NSExceptionHowever, if I get an exception while using the iOS 10 simulator, everything works as intended - the faulty line/row in my code is highlighted and I get a call stack and an error message which actually makes sense...