Post

Replies

Boosts

Views

Activity

Reply to ScreenCaptureKit - Sample project doesn't capture audio on MacOS 13.3
Replacing the createPCMBuffer func for this one fixed the issue (source: https://stackoverflow.com/questions/75228267/avaudioplayernode-causing-distortion) Are there any concerns in doing it this way? func createPCMBuffer(from sampleBuffer: CMSampleBuffer) -> AVAudioPCMBuffer? { let numSamples = AVAudioFrameCount(sampleBuffer.numSamples) let format = AVAudioFormat(cmAudioFormatDescription: sampleBuffer.formatDescription!) let pcmBuffer = AVAudioPCMBuffer(pcmFormat: format, frameCapacity: numSamples)! pcmBuffer.frameLength = numSamples CMSampleBufferCopyPCMDataIntoAudioBufferList(sampleBuffer, at: 0, frameCount: Int32(numSamples), into: pcmBuffer.mutableAudioBufferList) return pcmBuffer } Thanks
Apr ’23