-
Notifications
You must be signed in to change notification settings - Fork 150
Allow exact matches to include the hostapi's name in _get_device_id #360
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
Conversation
I just realized that the way I planned to craft identifying strings for config files is problematic.
So I'm not sure if this pull request would really help in its current form... One possibility, that would also help with 2. and #279: What if we exclude strings like What do you think? |
Ok, I think I found a nice solution, that will not introduce changes to the public API, so I updated the PR :) The new code would allow the exact matching of the device's name, if
(The current implementation of 0.4.2 allows 1., the initial PR only allows 1. and 2.) Also it solves #279, even when the query contains the hostapi's name. With this change, it will be possible to craft strings for config files, that will always give you the correct device when queried, like this: |
Thanks for this PR!
Yes, that sounds reasonable, I wasn't aware of this problem. I don't really like the recent update, though. I don't want to make any assumptions about the device string that's provided by PortAudio. |
Hi, I'm fine with that!
I thought that was a reasonable boundary to draw, so I already solved the problem within my own code. |
Thanks! I've cherry-picked your first commit into the |
Hi there,
here is a suggestion for a change of _get_device_id:
When a string of the form "device_name, host_api" name is queried, it should count as an exact match if it matches full_string.
This would solve the following problem, I currently encounter. I want to use strings in the specified format to store audio settings in configuration files. But this will happen:
Without the hostapi part, the error does not occur. However, I cannot omit it, because on Windows, there are sometimes devices with identical names, but different APIs.