Skip to content

Commit

Permalink
API Call Fix
Browse files Browse the repository at this point in the history
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
  • Loading branch information
david-bour committed Feb 3, 2019
1 parent c12de0c commit 29d3dc9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# IDE settings
.vscode

# Windows image file caches
Thumbs.db
ehthumbs.db
Expand Down
4 changes: 2 additions & 2 deletions python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 29d3dc9

Please sign in to comment.