Is anyone else experiencing a popping sound when recording audio in iOS using AudioKit? I've had my recorder working for a while now and all the sudden out of nowhere I have popping noises and I didn't touch my code. But I did upgrade AudioKit versions and I'm wondering if this is a bug with AudioKit?
I am using AudioKit version 4.7. Unfortunately, I haven't been able to test version 4.6.4 to see if that was the issue. My project is using the Swift 5.0 compiler so 4.6.4 won't compile and I haven't had time to create example projects. Wondering if this is a known issue.
Here's my recording code (which hasn't changed for months):
AKAudioFile.cleanTempDirectory()
// Session settings
AKSettings.bufferLength = .medium
AKSettings.defaultToSpeaker = true
// Patching
mic = AKMicrophone()
micMixer = AKMixer(mic)
micBooster = AKBooster(micMixer)
micBooster.gain = 0
//plot
let plot = AKNodeOutputPlot(self.mic, frame: self.plotView.bounds)
plot.plotType = .buffer
plot.shouldFill = false
plot.shouldMirror = true
plot.color = UIColor.black
self.plotView.addSubview(plot)
//end plot
micBooster!.gain = 0
recorder = try? AKNodeRecorder(node: micMixer)
if let file = recorder.audioFile {
player = try? AKAudioPlayer(file: file)
}
player?.looping = false
player?.completionHandler = playingEnded
mainMixer = AKMixer(player!, micBooster)
tracker = AKFrequencyTracker(micMixer)
silence = AKBooster(tracker, gain: 0)
AudioKit.output = mainMixer!
do {
try AudioKit.start()
} catch {
AKLog("AudioKit did not start!")
}