I propose to add the following commands related to audio volume. If approved I will implement this myself.
(As a result of discussion below I dropped two out of four proposals and marked them as deleted; but keeping them in the list to preserve their indexes)
NVDA+Control+PageUp/PageDown - adjust NVDA volume
NVDA+Alt+PageUp/PageDown - adjust volume of all other applications except NVDA.
NVDA+alt+s: sound splitter: send NVDA sound to left channel while sound from all other applications to the right channel.
NVDA+delete toggle microphone mute.
I will not insist on these gestures, so feel free to propose other gestures. It would also be fine with me to leave them unassigned.
Utility
Sound split function, initially implemented in Tony's enhancements add-on proved to be very popular among NVDA users, to the extent that it was copied by @josephsl into Sound Splitter add-on and also was copied in NVDA Extension global plugin. On one hand this proves the demand for sound splitting feature; and on the other hand having the same feature implemented in so many add-ons creates incompatibility between them that hurts end users. Therefore I believe it would be benficial to implement this feature in NVDA core. Another reason is that with the recent switch to wasApi, at least two out three add-ons now suffer from compatibility problems, which means it is perfect time to move this feature into NVDA core.
Adjusting the volume of NVDA and other apps separately is closely connected with sound splitting feature: since we diinto two streams, we need to have a way to control their volumes separately.
Toggle microphone mute command proves immensely helpful for people like me who work in large IT companies and have to frequently attend online meetings. At Meta two other screenreader users expressed interest in that command, although they are Jaws users, but this still illustrates the demand.
Technical details
In Tony's enhancements add-on I implemented these commands by using PyCaw library; however if I remember correctly I grabbed a modified version of this library from yet another add-on, name of which I don't remember at this point.
In order to implement this PR, I see a bunch of different approaches with regards to interaction with Audio Manager interface:
- Add latest version of PyCaw library to the list of dependencies. Drawback: PyCaw seems to rely on a bunch of other libraries.
- Reuse modified version of PyCaw to NVDA. Drawback: this way seems to be quite hacky.
- Reuse COM interface ddefinitions from PyCaw but implement all logic from scratch. This seems to be the best option to me at this point.
- Generate COM interface definition from scratch. I don't have much experience with COM interaction and couldn't figure out how this can be done. I see that NVDA source has a folder
comInterfaces that appear to have many COM interfaces seemingly generated in an automatic fashion, but I couldn't figure out how to do that myself.
At this point I prefer option 3, but I'd like to check with NVAccess if you have different opinion. I wish I could go ahead with option 4, but I spent quite some time trying to generate COM interfaces for MMDevAPI.dll module with no success, so if anyone can teach me how to do so - option 4 would be a great choice then.
Another detail to call out is the fact that we'd need to create a separate thread to monitor audio sessions. It turns out audio sessions tend to come and go when new applications launch and for example when new system notification sounds play. We need to catch them and apply volume settings as they appear, therefore I implemented a monitor thread that performs this check every second. I haven't found a better solution, so wanted to check with NVAccess if you'd be okay with creating a monitor thread. That thread will only be running when sound split is active.
I propose to add the following commands related to audio volume. If approved I will implement this myself.
(As a result of discussion below I dropped two out of four proposals and marked them as deleted; but keeping them in the list to preserve their indexes)
NVDA+Control+PageUp/PageDown- adjust NVDA volumeNVDA+Alt+PageUp/PageDown- adjust volume of all other applications except NVDA.NVDA+alt+s: sound splitter: send NVDA sound to left channel while sound from all other applications to the right channel.NVDA+deletetoggle microphone mute.I will not insist on these gestures, so feel free to propose other gestures. It would also be fine with me to leave them unassigned.
Utility
Sound split function, initially implemented in Tony's enhancements add-on proved to be very popular among NVDA users, to the extent that it was copied by @josephsl into Sound Splitter add-on and also was copied in NVDA Extension global plugin. On one hand this proves the demand for sound splitting feature; and on the other hand having the same feature implemented in so many add-ons creates incompatibility between them that hurts end users. Therefore I believe it would be benficial to implement this feature in NVDA core. Another reason is that with the recent switch to wasApi, at least two out three add-ons now suffer from compatibility problems, which means it is perfect time to move this feature into NVDA core.
Adjusting the volume of NVDA and other apps separately is closely connected with sound splitting feature: since we diinto two streams, we need to have a way to control their volumes separately.
Toggle microphone mute command proves immensely helpful for people like me who work in large IT companies and have to frequently attend online meetings. At Meta two other screenreader users expressed interest in that command, although they are Jaws users, but this still illustrates the demand.
Technical details
In Tony's enhancements add-on I implemented these commands by using PyCaw library; however if I remember correctly I grabbed a modified version of this library from yet another add-on, name of which I don't remember at this point.
In order to implement this PR, I see a bunch of different approaches with regards to interaction with Audio Manager interface:
comInterfacesthat appear to have many COM interfaces seemingly generated in an automatic fashion, but I couldn't figure out how to do that myself.At this point I prefer option 3, but I'd like to check with NVAccess if you have different opinion. I wish I could go ahead with option 4, but I spent quite some time trying to generate COM interfaces for
MMDevAPI.dllmodule with no success, so if anyone can teach me how to do so - option 4 would be a great choice then.Another detail to call out is the fact that we'd need to create a separate thread to monitor audio sessions. It turns out audio sessions tend to come and go when new applications launch and for example when new system notification sounds play. We need to catch them and apply volume settings as they appear, therefore I implemented a monitor thread that performs this check every second. I haven't found a better solution, so wanted to check with NVAccess if you'd be okay with creating a monitor thread. That thread will only be running when sound split is active.