Skip to content

Commit 6c9e9f2

Browse files
committed
Add "index" field to device dict
1 parent b7962d7 commit 6c9e9f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sounddevice.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,8 @@ def query_devices(device=None, kind=None):
476476
477477
``'name'``
478478
The name of the device.
479+
``'index'``
480+
The device index.
479481
``'hostapi'``
480482
The ID of the corresponding host API. Use
481483
`query_hostapis()` to get information about a host API.
@@ -580,6 +582,7 @@ def query_devices(device=None, kind=None):
580582
raise
581583
device_dict = {
582584
'name': name,
585+
'index': device,
583586
'hostapi': info.hostApi,
584587
'max_input_channels': info.maxInputChannels,
585588
'max_output_channels': info.maxOutputChannels,

0 commit comments

Comments
 (0)