From 6c9e9f20217d29af45c39cf300337791e2a2fe35 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Thu, 5 May 2022 21:58:51 +0200 Subject: Add "index" field to device dict --- sounddevice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sounddevice.py b/sounddevice.py index 1600148..862aaa0 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -476,6 +476,8 @@ def query_devices(device=None, kind=None): ``'name'`` The name of the device. + ``'index'`` + The device index. ``'hostapi'`` The ID of the corresponding host API. Use `query_hostapis()` to get information about a host API. @@ -580,6 +582,7 @@ def query_devices(device=None, kind=None): raise device_dict = { 'name': name, + 'index': device, 'hostapi': info.hostApi, 'max_input_channels': info.maxInputChannels, 'max_output_channels': info.maxOutputChannels, -- cgit v1.2.3