import AVFoundation import Foundation extension AudioNode: CustomStringConvertible { var description: String { var description: [String] = [] for scope in BusScope.allCases { guard let busCount = try? busCount(scope: scope) else { description.append("failed to get \(scope.rawValue) bus count") continue } guard busCount > 0 else { continue } var busDescription: [String] = [] for busIndex in 0...size let parameterIds = UnsafeMutablePointer.allocate(capacity: numberOfParameters) defer { parameterIds.deallocate() } if numberOfParameters > 0 { status = AudioUnitGetProperty(audioUnit, kAudioUnitProperty_ParameterList, kAudioUnitScope_Global, 0, parameterIds, ¶meterListSize) guard status == noErr else { throw Error.unableToRetrieveValue(status) } } var info = AudioUnitParameterInfo() var infoSize = UInt32(MemoryLayout.size) for i in 0..