title: How to play and listen to audio at the same time using AVAudioSession
body: <p>I'm using standard code to start listening to microphone and using SHSession delegate detect song with ShazamKit.</p>
  <pre><code>let audioSession = AVAudioSession.sharedInstance()
  audioSession.requestRecordPermission { isGranted in
      guard isGranted else { return }
      try? audioSession.setActive(true, options: .notifyOthersOnDeactivation)
      let inputNode = self.audioEngine.inputNode
      let recordingFormat = inputNode.outputFormat(forBus: 0)
      inputNode.installTap(onBus: 0, bufferSize: 1024, format: recordingFormat) {
          (buffer: AVAudioPCMBuffer, when: AVAudioTime) in
          self.session.matchStreamingBuffer(buffer, at: nil)
      }
      self.audioEngine.prepare()
      do {
          try self.audioEngine.start()
      } catch (let error) {
          assertionFailure(error.localizedDescription)
      }
  }
  
  </code></pre>
  <p>Everything works fine when song detection is happening by listening to some external sound sources like music column. But I need to provide opportunity to turn on some song from another app (Soundcloud for example), open my app and detect it. But when this block of code if executed, song playing stops. I tried to change bus value, buffer size, add some categories via setCategory method but nothing helps me. As I suggest, issue might be caused by using the same resources like bus, but as I already mentioned, I tried to change this value</p>