-
-
Notifications
You must be signed in to change notification settings - Fork 651
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 SAPI 5 initialisation #17513
Fix SAPI 5 initialisation #17513
Conversation
See test results for failed build of commit 1c6a4fbd0c |
Works for me. This should be merged as soon as possible. |
This might impact SAPI 4 as well I guess. Right? |
No @Adriani90, |
This is my SAPI4 error log, with code:
It's also |
The problem is that unlike SAPI5 which allows you to enumerate audio devices and compare the names, SAPI4 only accepts a device number, so you will have to get the device number elsewhere. The fix for SAPI5 cannot be easily applied to SAPI4. |
@gexgd0419, thanks for the info. We are already aware of the cause and are working to implement a fix. |
I just thought of a question: what if two audio endpoints use the same description string (friendly name)? For example, a user connects two speakers/headphones with the exact same model. Will only one of them be able to be selected? This problem is mentioned in Endpoint ID Strings.
If you are using MME, then
So maybe we still need to keep some WinMM related code to perform conversion from WASAPI device IDs to WinMM device indexes. |
Or maybe we can make a unified audio processing system in NVDA, so that instead of allowing each synthesizers to send their audio to the speaker on its own, make the synthesizers send the audio to NVDA. Then it will be possible to perform some audio processing, for example, silence removing, before sending the audio to the speaker. Also, you will be able to get rid of WinMM entirely. |
@gexgd0419 the issue with duplicate friendly names is one of the reasons we're switching to using endpoint IDs. This fix was implemented as that work was not ready to merge, so that SAPI5 would not be broken over the Christmas/New Years break. |
Link to issue number:
Closes #17512
Fix-up of #17496
Summary of the issue:
After the removal of winmm support, SAPI5 synthesisers failed to initialise.
This is because we switched from integer-based IDs as used by winmm, to ID strings as used by Windows Core Audio.
Description of user facing changes
SAPI5 synthesisers now initialise correctly.
Description of development approach
Rather than calling
outputDeviceNameToID
to index into the audio outputs returned by SAPI, iterate over them and look for one whoseDescription
matches the friendly name of the output device to use as stored in the user's config.Testing strategy:
Tested loading SAPI5 with a number of output devices selected, and changing output devices with SAPI5 loaded.
Known issues with pull request:
None.
Code Review Checklist:
@coderabbitai summary