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
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’23
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
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’23
Reply to ScreenCaptureKit - Sample project doesn't work on macOS Sonoma
@lzell I was able to "fix" it by changing the CaptureEngine class to also implement SCStreamOutput and SCStreamDelegate. So now, I'm sending self instead of streamOutput to addStreamOutput. try stream?.addStreamOutput(self, type: .screen, sampleHandlerQueue: videoSampleBufferQueue)
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’23
Reply to failedApplicationConnectionInterrupted
I'm getting the same error from ScreenCaptureKit, and I suspect it's coming from ReplayKit, did you find any solution?
Topic: Media Technologies SubTopic: General Tags:
Replies
Boosts
Views
Activity
Apr ’24