From 29d3dc9a29620fed0ca750d592e178aa1e6fee61 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 3 Feb 2019 12:24:34 -0800 Subject: [PATCH] API Call Fix The incorrect method was being used for finding the device which led to an IndexError. Since we're attempting to add all of the devices, we should be using the method 'get_device_info_by_index` which will properly fetch the amount of devices we have --- .gitignore | 3 +++ python/main.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2c306ee..7239a64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# IDE settings +.vscode + # Windows image file caches Thumbs.db ehthumbs.db diff --git a/python/main.py b/python/main.py index dfa7a73..f8e3b28 100644 --- a/python/main.py +++ b/python/main.py @@ -838,8 +838,8 @@ def __init__(self, callback_func): self.devices = [] #for each audio device, add to list of devices - for i in range(0,self.numdevices): - device_info = py_audio.get_device_info_by_host_api_device_index(0,i) + for i in range(0, self.numdevices): + device_info = py_audio.get_device_info_by_index(i) if device_info["maxInputChannels"] > 1: self.devices.append(device_info)