-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Method Usage #71
base: master
Are you sure you want to change the base?
Fix Method Usage #71
Conversation
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
Thank you! But now I get this error..:( (RGB) bash-3.2$ python main.py |
Try adding this line of code in #53 |
I will try when Im at home. By the way do I need to edit just main.py file or also .gitignore file? Its shown here: 29d3dc9 |
I just modify main.py, does it work for you?
…On Tue, Feb 5, 2019, 7:58 AM Andriejus ***@***.*** wrote:
I will try when Im at home. By the way do I need to edit just main.py file
or also .gitignore file? Its shown here: 29d3dc9
<29d3dc9>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/As6sG-zrXk6uWc2tgv7IliIaFxH3roOfks5vKY4bgaJpZM4agS_L>
.
|
It worked for me. Now Im able to choose not only microphone or built-in input. But if I make some changes in sound settings on my computer (like disabling microphone), so it crashes. I think you should set your sound settings right before you launch main.py. I played with sound settings and if microphone was disabled, so I couldnt run main.py (it crashes with syntax error). Im trying to find out how to set audio settings right in order to play music from my computer. Now Im able to use it only with microphone. Tried to use program "soundflower", but Im not sure how to use it:) I need to watch some tutorials. |
Let me know your right audio configuration men, we can do the same to see
if that's the problem
…On Wed, Feb 6, 2019, 2:57 AM Andriejus ***@***.*** wrote:
It worked for me. Now Im able to choose not only microphone or built-in
input. But if I make some changes in sound settings on my computer (like
disabling microphone), so it crashes. I think you should set your sound
settings right before you launch main.py. I played with sound settings and
if microphone was disabled, so I couldnt run main.py (it crashes with
syntax error). Im trying to find out how to set audio settings right in
order to play music from my computer. Now Im able to use it only with
microphone. Tried to use program "soundflower", but Im not sure how to use
it:) I need to watch some tutorials.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/As6sG66fz8csfVBMgwccpMwsw3jBj8fIks5vKpj_gaJpZM4agS_L>
.
|
tl;dr
There might have been a mix up with the following available API calls
get_device_info_by_index(device_index)
get_device_count()
get_host_api_count()
get_host_api_info_by_index(host_api_index)
get_device_info_by_host_api_device_index(host_api_index, host_api_device_index)
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.
This issue was also raised in #47 and #53
Issue
Run
PyAudio().get_default_host_api_info()
Windows 10
Looking into the docs further, we see that the
Invalid device
error is described assource: portaudio docs
If I do
PyAudio().get_device_count()
, it lists 13 devices! That's way more than I have when I checked it usingPyAudio().get_default_host_api_info()
andPyAudio().get_host_api_count()
which lists 2.So what this means is if I try
PyAudio().get_device_info_by_host_api_device_index(0,index)
, I will always have an index error because the host only has 2 while I have 13 devices in total on my setup. Sometimes this will work seamlessly for people because their rig has the same amount of devices as their PortAudio Host APIs count.The fix is to simply swap out the method call to
get_device_info_by_index(device_index)