title: How to send Microphone and InApp Audio CMSampleBuffer to webRTC in swift?
body: <p>I am working on-screen broadcast application. I want to send my screen recording on WebRTC server.</p>
  
  <pre><code>override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
          //if source!.isSocketConnected {
              switch sampleBufferType {
              case RPSampleBufferType.video:
                  // Handle video sample buffer
                  source?.processVideoSampleBuffer(sampleBuffer)
                  break
              case RPSampleBufferType.audioApp:
                  // Handle audio sample buffer for app audio
                  source?.processInAppAudioSampleBuffer(sampleBuffer)
  
                  break
              case RPSampleBufferType.audioMic:
                  // Handle audio sample buffer for mic audio
                  source?.processAudioSampleBuffer(sampleBuffer)
                  break
              @unknown default:
                  break
              }
      }
  
  
  // VideoBuffer Sending Method
  func startCaptureLocalVideo(sampleBuffer: CMSampleBuffer) {
  
          let _pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer)
          if let pixelBuffer = _pixelBuffer {
              let rtcPixelBuffer = RTCCVPixelBuffer(pixelBuffer: pixelBuffer)
              let timeStampNs = CMTimeGetSeconds(CMSampleBufferGetPresentationTimeStamp(sampleBuffer)) * 1000000000
              let rtcVideoFrame = RTCVideoFrame(buffer: rtcPixelBuffer, rotation: RTCVideoRotation._90, timeStampNs: Int64(timeStampNs))
  
              localVideoSource!.capturer(videoCapturer!, didCapture: rtcVideoFrame)
          }
  
      }
  </code></pre>
  
  <p>I got success to send VIDEO Sample Buffer on WebRTC but I am getting stuck in AUDIO part.</p>
  
  <p>I did not find any way how to send AUDIO buffer to WebRTC.</p>
  
  <p>Thank you so much for your answer.</p>