NAudio
NAudio copied to clipboard
Win 11: unable to find out the USB device via EnumerateAudioEndPoints
I am using the NAduio v2.1 and try to look up the USB device after it is attached, but no that USB device is found on Win 11, however it is visible on Device Manager.
Sample code:
var enumerator = new MMDeviceEnumerator();
var deviceCollection = enumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active);
Foreach the device in deviceCollection, no USB device is not found, see the below log print
Lookup device friendly name. AudioDeviceName='Engage 40' Name='Engage 40'
Enumerate devices (number=1)
device.DeviceFriendlyName='Internal microphone
Appraently the number of enumerated devices is wrong, in this case, should be 2, not 1. The device "Engage 40" should be printed like "Internal microphone", however, it is not.
NAudio simply calls through to Windows APIs, so you get whatever Windows reports, based on the options you chose. The names reported by each device are determined by the writers of the device manager.
You've selected DeviceState.Active which might be eliminating some of the options from the return list