UAC配置描述符拓扑结构麦克风和扬声器判断
2025-11-27
本文链接为:http://www.usbzh.com/article/detail-1599.html ,欢迎转载,转载请附上本文链接。
UAC的配置描述符说明了UAC设备的拓扑结构。
而拓扑结构中最主重要的就是输入终端和输出终端。
输入终端和输出终端和其它的拓扑单元构成了最基本的UAC拓扑结构和数据流向。
但是通过输入终端的类型可以判断是数据流输入到主机还是到设备,这就可以判断是麦克风还是扬声器。
扬声器
如有如下的拓扑结构,描述符如下:
------- Audio Control Input Terminal Descriptor -------
bLength : 0x0C (12 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x02 (Input Terminal)
bTerminalID : 0x01
wTerminalType : 0x0101 (USB Streaming)
bAssocTerminal : 0x00
bNrChannels : 0x02 (2 channels)
wChannelConfig : 0x0003 (L, R)
iChannelNames : 0x08 (String Descriptor 8)
Language 0x0409 : "Playback Channels"
iTerminal : 0x07 (String Descriptor 7)
Language 0x0409 : "Playback Input terminal"
Data (HexDump) : 0C 24 02 01 01 01 00 02 03 00 08 07 .$..........
------- Audio Control Output Terminal Descriptor ------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x03 (Output Terminal)
bTerminalID : 0x03
wTerminalType : 0x0405 (Echo-canceling speakerphone)
bAssocTerminal : 0x00 (0)
bSourceID : 0x01 (1)
iTerminal : 0x09 (String Descriptor 9)
Language 0x0409 : "USBZH Audio"
Data (HexDump) : 09 24 03 03 05 04 00 01 09 .$.......
其拓扑结构如下:
可以看到,输入终端的类型为0x0101 (USB Streaming),表示数据来源于USB端,所以这就是一个扬声器。
麦克风
------- Audio Control Input Terminal Descriptor -------
bLength : 0x0C (12 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x02 (Input Terminal)
bTerminalID : 0x02
wTerminalType : 0x0405 (Echo-canceling speakerphone)
bAssocTerminal : 0x00
bNrChannels : 0x01 (1 channel)
wChannelConfig : 0x0001 (L)
iChannelNames : 0x0B (String Descriptor 11)
Language 0x0409 : "Capture Channels"
iTerminal : 0x0A (String Descriptor 10)
Language 0x0409 : "USBZH Audio"
Data (HexDump) : 0C 24 02 02 05 04 00 01 01 00 0B 0A .$..........
------- Audio Control Output Terminal Descriptor ------
bLength : 0x09 (9 bytes)
bDescriptorType : 0x24 (Audio Interface Descriptor)
bDescriptorSubtype : 0x03 (Output Terminal)
bTerminalID : 0x04
wTerminalType : 0x0101 (USB Streaming)
bAssocTerminal : 0x00 (0)
bSourceID : 0x02 (2)
iTerminal : 0x0C (String Descriptor 12)
Language 0x0409 : "Capture Output terminal"
Data (HexDump) : 09 24 03 04 01 01 00 02 0C
其拓扑结构如下:
可以看到,其输出终端的类型为0x0101 (USB Streaming),表示数据流向到USB,所以这是一个麦克风。
HID人机交互QQ群:564808376
UAC音频QQ群:218581009
UVC相机QQ群:331552032
BOT&UASP大容量存储QQ群:258159197
STC-USB单片机QQ群:315457461
USB技术交流QQ群2:580684376
USB技术交流QQ群:952873936 USB技术交流3:1031974172
UAC开发调试笔记





