     @objc public static var engine: AVAudioEngine {
         get {
             // Access a few attributes immediately so things are initialized properly
+            #if !os(tvOS)
             _ = _engine.inputNode
+            #endif
             _ = AudioKit.deviceSampleRate
             return _engine
         }

    }

    #if os(macOS)
        /// Enumerate the list of available devices.
        @objc public static var devices: [AKDevice]? {
            EZAudioUtilities.setShouldExitOnCheckResultFail(false)
            return EZAudioDevice.devices().map { AKDevice(ezAudioDevice: $0 as! EZAudioDevice) }
        }
    #endif

    /// Enumerate the list of available input devices.
    @objc public static var inputDevices: [AKDevice]? {
        #if os(macOS)
            EZAudioUtilities.setShouldExitOnCheckResultFail(false)
            return EZAudioDevice.inputDevices().map { AKDevice(ezAudioDevice: $0 as! EZAudioDevice) }
        #else
            var returnDevices = [AKDevice]()
            if let devices = AVAudioSession.sharedInstance().availableInputs {
                for device in devices {
                    if device.dataSources == nil || device.dataSources!.isEmpty {
                        returnDevices.append(AKDevice(portDescription: device))
                    } else {
                        for dataSource in device.dataSources! {
                            returnDevices.append(AKDevice(name: device.portName,
                                                          deviceID: "\(device.uid) \(dataSource.dataSourceName)"))
                        }
                    }
                }
                return returnDevices
            }
            return nil
        #endif
    }

    /// Enumerate the list of available output devices.
    @objc public static var outputDevices: [AKDevice]? {
        #if os(macOS)
            EZAudioUtilities.setShouldExitOnCheckResultFail(false)
            return EZAudioDevice.outputDevices().map { AKDevice(ezAudioDevice: $0 as! EZAudioDevice) }
        #else
            let devs = AVAudioSession.sharedInstance().currentRoute.outputs
            if devs.isNotEmpty {
                var outs = [AKDevice]()
                for dev in devs {
                    outs.append(AKDevice(name: dev.portName, deviceID: dev.uid))
                }
                return outs
            }
            return nil
        #endif
    }

    /// The name of the current input device, if available.
    @objc public static var inputDevice: AKDevice? {
        #if os(macOS)
            if let dev = EZAudioDevice.currentInput() {
                return AKDevice(name: dev.name, deviceID: dev.deviceID)
            }
        #else
            if let portDescription = AVAudioSession.sharedInstance().preferredInput {
                return AKDevice(portDescription: portDescription)
            } else {
                let inputDevices = AVAudioSession.sharedInstance().currentRoute.inputs
                if inputDevices.isNotEmpty {
                    for device in inputDevices {
                        return AKDevice(portDescription: device)
                    }
                }
            }
        #endif
        return nil
    }

    /// The name of the current output device, if available.
    @objc public static var outputDevice: AKDevice? {
        #if os(macOS)
        if let dev = EZAudioDevice.currentOutput() {
            return AKDevice(name: dev.name, deviceID: dev.deviceID)
        }
        #else
        let devs = AVAudioSession.sharedInstance().currentRoute.outputs
        if devs.isNotEmpty {
            return AKDevice(name: devs[0].portName, deviceID: devs[0].uid)
        }

        #endif
        return nil
