我正在尝试在 iOS 上使用 WebRTC 流式传输 CMSampleBuffer 视频/音频组合,但我在尝试捕获音频时遇到了麻烦。视频效果很好:
guard let pixelBuffer = CMSampleBufferGetImageBuffer(sampleBuffer) else {
print("couldn't get image from buffer :~(")
return
}
let rtcPixelBuffer = RTCCVPixelBuffer(pixelBuffer: pixelBuffer)
let rtcVideoFrame = RTCVideoFrame(buffer: rtcPixelBuffer, rotation: ._0, timeStampNs: timeStampNs)
videoSource.capturer(videoCapturer, didCapture: rtcVideoFrame)
谈到音频,我在课堂上看不到任何方法RTCAudioSource
来捕获音频,任何帮助将不胜感激!