2

I see in Crashlytics few users are getting this exception when connecting the inputNode to mainMixerNode in AVAudioEngine:

   Fatal Exception: com.apple.coreaudio.avfaudio
   required condition is false: format.sampleRate == hwFormat.sampleRate

Here is my code:

    self.engine = AVAudioEngine()
    
    let format = engine.inputNode.inputFormat(forBus: 0)
    
    //main mixer node is connected to output node by default
    engine.connect(self.engine.inputNode, to: self.engine.mainMixerNode, format: format)

Just want to understand how can this error occur and what is the right fix?

Deepak Sharma
  • 5,577
  • 7
  • 55
  • 131

0 Answers0