From 6a31596356f1c9b5baa3d14e0773da04f7b1d2a7 Mon Sep 17 00:00:00 2001 From: shogo4405 Date: Tue, 23 Apr 2024 02:19:21 +0900 Subject: [PATCH] Enable audio capture from separate sources on macOS. --- Sources/IO/IOAudioCaptureUnit.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/IO/IOAudioCaptureUnit.swift b/Sources/IO/IOAudioCaptureUnit.swift index 7067db2b8..a445282dc 100644 --- a/Sources/IO/IOAudioCaptureUnit.swift +++ b/Sources/IO/IOAudioCaptureUnit.swift @@ -41,6 +41,9 @@ public final class IOAudioCaptureUnit: IOCaptureUnit { self.device = device input = try AVCaptureDeviceInput(device: device) output = AVCaptureAudioDataOutput() + if let input, let output { + connection = AVCaptureConnection(inputPorts: input.ports, output: output) + } } func setSampleBufferDelegate(_ audioUnit: IOAudioUnit?) {