0

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!")
  }
mnearents
  • 646
  • 1
  • 6
  • 31
  • Can you describe the popping noise? Is it a single pop? Or are there multiple pops? Or is it more of a distortion? – dave234 Apr 22 '19 at 14:29
  • It’s more of a distortion whenever the mic picks up sound. – mnearents Apr 22 '19 at 14:31
  • I can post an example audio file here in a little bit. – mnearents Apr 22 '19 at 14:34
  • This sounds like a sample rate mis-match, there are some bugs around AudioKit where it interfaces with the hardware I believe. – dave234 Apr 22 '19 at 14:35
  • To verify that it is a sample rate mismatch, try without defaultToSpeaker to see if it’s fixed. – dave234 Apr 22 '19 at 14:47
  • Yes, that worked. Does that mean I should file a bug with AudioKit? However now my audio doesn't play through the speaker so is there anything I can do for my app? It's currently on the appStore with the distortion and I was trying to release an update to fix it. – mnearents Apr 22 '19 at 15:28
  • Yeah, an issue (if one doesn’t already exist) seems appropriate. Hopefully the AudioKit community can offer a workaround. – dave234 Apr 22 '19 at 15:30
  • Sweet, thanks for the help. – mnearents Apr 22 '19 at 18:07

0 Answers0