Trial & error coupled with scouring the web has yielded at least a partial answer:
import AVFoundation
import Cocoa
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
let engine = AVAudioEngine()
let inputNode = engine.inputNode
let format = inputNode.inputFormat(forBus: 0)
let outputNode = engine.outputNode
engine.connect(inputNode, to: outputNode, format: format)
//var bufferCount = 0
//input.installTap(onBus: 0, bufferSize: 2048, format: nil) { audioBuffer, audioTime in
// bufferCount += 1
// print(bufferCount)
//}
engine.prepare()
do {
try engine.start()
} catch {
print(error)
}
Ridiculously simple but amazingly difficult to stumble upon. At least, that was my experience. Next, I need a way to enumerate the inputs so I can pick the microphone I want to use. Anyone have a clue on how that is accomplished on macOS? During my time researching this problem, I noticed that things are much easier and much better documented for iOS.