The numberOfInputs property of the AudioNode interface returns the number of inputs feeding the node.
numberOfInputs
MDN Reference