0

I was working on USB Devices. Every where i get examples as speaker for Audio class and keyboard, mouse for HID class. As per my understanding we use HID class API's to enumerate audio devices like speaker etc., so what more extra functionality is present in Audio class. So how can i differentiate between Audio Class and HID class.

Please can anyone give a better understanding on that?

Karthikgr
  • 81
  • 13
  • This sounds wrong: "use HID class API's to enumerate audio devices like speaker". Can you get more specific about what actual problem you are having, what attempts you have made so far to solve it, and post your code? You should be able to distinguish audio class and HID class devices by looking at the bDeviceClass or bInterfaceClass fields in the device's Device Descriptor or Interface Descriptor. – David Grayson Feb 05 '20 at 19:07
  • Thanks @DavidGrayson. My question is, assume i am using IOKIT HID API to enumerate audio devices like speakers, headsets etc. So not only i enumerate keyboard and mouse but i am able to enumerate speakers and headsets. So everything i am doing using HID class and hid api set right? so what is Audio class? what is it used for? when it is used? And what is the difference between a audio class and hid class? – Karthikgr Feb 06 '20 at 02:48
  • I know in theory, common properties are combined together and have been formed a class like audio class and hid class. i know hid class is where human interaction with the device involves? But how can i understand audio class? Even though i can use hid api's for enumerating an audio device or read/write to audio devices!! but what is audio class and it is used for? because everywhere speakers are given an example for audio class and not hid class?? – Karthikgr Feb 06 '20 at 02:55
  • The HID specification is here: https://www.usb.org/hid The Audio class specification is here: https://www.usb.org/sites/default/files/audio10.pdf I don't know why IOKit would allow you to enumerate speakers using HID APIs; that is either just an oddity of Apple's design of that API, or you are confused about what is going on. From a USB perspective, the two classes are different have different purposes. – David Grayson Feb 06 '20 at 03:43
  • Thanks @DavidGrayson, i am little confused as u said on why audio class is made and how it is used.I will refer to the above link. – Karthikgr Feb 06 '20 at 04:31

0 Answers0