AVCaptureDevice.DiscoverySession, virtual audio driver is not listed

I try to get AVCaptureDevice instance of a virtual audio plugin, like blackhole.

I need to call AVCaptureDevice.DiscoverySession, because old method (AVCaptureDevice.devicesWithMediaType) is deprecated. First, I cannot find enum for virtual audio plugin. I try .externalUnknown or .builtInMicrophone. Both result is empty.

I like to know how to list virtual microphone and get AVCaptureDevice instance.

let deviceDiscoverySession = AVCaptureDevice.DiscoverySession(
    deviceTypes: [ .externalUnknown ],
    mediaType: .audio,
    position: .unspecified
)
let devs = deviceDiscoverySession.devices
print("devices=\(devs)") // empty list

Do you have the entitlement com.apple.security.device.microphone?

AVCaptureDevice.DiscoverySession, virtual audio driver is not listed
 
 
Q