wpf - List of capture devices (e.g. Microphone, Stereo Mix...) in C# -
how can list of avalible sound devices? mean in image.
i want in combobox. mean only:
- microphone
- stereo mix
- line in
- ..and more..
but must because system changes name of device according language localization system, , that's need.
for example, in langueage microphone called mikrofon , stereo mix = směšovač stereo
and need names of devices, nothing other
can make example code?
following code should getting list of audio devices,
managementobjectsearcher objsearcher = new managementobjectsearcher( "select * win32_sounddevice"); managementobjectcollection objcollection = objsearcher.get(); foreach (managementobject obj in objcollection) { foreach (propertydata property in obj.properties) { console.out.writeline(string.format("{0}:{1}", property.name, property.value)); } }
now, can enumerate on list using for-each
.
edited
output this,
availability: caption:usb audio device configmanagererrorcode:0 configmanageruserconfig:false creationclassname:win32_sounddevice description:usb audio device deviceid:usb\vid_047f&pid_0ca1&mi_00\6&2c037688&0&0000 pnpdeviceid:usb\vid_047f&pid_0ca1&mi_00\6&2c037688&0&0000 powermanagementcapabilities: powermanagementsupported:false productname:usb audio device status:ok statusinfo:3 systemcreationclassname:win32_computersystem systemname: availability: caption:realtek ac'97 audio via (r) audio controller configmanagererrorcode:0 configmanageruserconfig:false creationclassname:win32_sounddevice description:realtek ac'97 audio via (r) audio controller deviceid:pci\ven_1106&dev_3059&subsys_09011558&rev_60\3&61aaa01&1&8d
take caption value list. simple text parsing problem ;)
Comments
Post a Comment