-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Add setting to have the volume of NVDA sounds follow the voice volume. #14896
Conversation
One other test case that should be here, I think: decrease the volume with the
setting enabled, and confirm sounds are low. Then disable the setting and
confirm that the voice is still low, but the sounds are high.
Personally, I think we need an audio settings panel, containing this setting,
the WASAPI or not setting, and probably (eventually?) the sound output device
setting that is currently found in the synth selection dialog.
There are other options that should probably end up there if eventually
implemented, such as the ability to change certain tone pitches, that negatively
impact people with hearing difficulties at their current fixed defaults.
(#10116, #9206)
|
I intentionally didn't include this test case, as I know it won't work. Whether it should is an interesting question. Strictly speaking, disabling the setting should prevent the sound volume from following the voice volume, but it doesn't say anything about snapping the volume back to maximum. The user might have had the sound volume set to something lower before they enabled follow. However, it also doesn't really make sense to me to keep track of the level the user set before enabling follow just so we can restore it later. |
If we did want to snap back to maximum, we'd need to do that when applying the disable change somehow. |
I intentionally didn't include this test case, as I know it won't work. Whether it should is an interesting question. Strictly speaking, disabling the
setting should prevent the sound volume from following the voice volume, but it doesn't say anything about snapping the volume back to maximum. The user
might have had the sound volume set to something lower before they enabled follow. However, it also doesn't really make sense to me to keep track of the
level the user set before enabling follow just so we can restore it later.
I hadn't considered it from that prospective, but I concede the point.
Why the objection to keeping track? I'm not saying I disagree, but I wonder what
your thinking is.
If your objection is to storing a representation of the volume in nvda.ini, one
possible way around this would be to keep track, but only for the session.
When the checkbox is checked, or NVDA starts with the box checked, record what
the volume was before matching it to speech.
When the box is unchecked, or NVDA shuts down, reset the volume to what was
remembered. This assumes that if NVDA is shut down with the box checked, but the
setting is not in the saved config, the system volume mixer will remember the
application's volumes on the next load.
Of course, that doesn't take into account unusual shutdowns.
|
Yeah, I'm slightly less bothered by storing it in the session, but the UX isn't great, since then the behaviour is inconsistent depending on whether the user enabled and disabled in the same session or not. The other challenge is how to apply the volume change when disabling. One way is to create a temporary WavePlayer using the sounds session just to adjust the session volume. We'd need to do this when applying in the dialog, when switching config profiles and when reverting the config. Perhaps a simpler way I'm considering is just to track the last state in the WavePlayer class. |
…the WASAPI checkbox is unchecked.
See test results for failed build of commit 2bcbc8b972 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks almost ready, thanks @jcsteh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jcsteh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs changes read well, good work!
Hi, I am trying this, but I feel that the volume of the tones does not go down linearly. With the option disabled, if I lower the volume of NVDA Sounds and NVDA to the same level using the Windows sound mixer, the sound is heard at a similar intensity. On the other hand, if I enable the option and lower the volume of the NVDA voice, the sounds remain louder than the voice at all times, except when the voice volume is 100. |
What voice are you using? This is going to depend on the voice somewhat, since the voice volume is controlled by the voice, not NVDA or Windows. If the voice volume isn't entirely linear, then there is going to be a mismatch. It seems to be fairly linear with eSpeak. |
Yes, I think that is the cause. I just tried Espeak and it works fine. Is there a way to make the NVDA sound unified? That is, if I lower the volume of NVDA in the Windows sound mixer, it lowers the volume of the voice and the volume of the tones equally, just as it works when you don't have Wasapi enabled. Thanks! |
There isn't a way to do that, no. They are separate sessions so that users can adjust them separately, but the flip side of that is that they are... well... adjustable separately. |
Sure, I understand. But isn't there a way I can be combined in one session? Just like it works in previous versions. That allows you to reduce the volume of NVDA from the Windows sound mixer, without having to worry about lowering the volume of NVDA and NVDA sounds. I understand that's the point of this PR, but as I was telling you, it doesn't work well with other synthesizers. Thanks! |
The point of this PR was that users wanted a way to do this which used the voice volume, since the voice volume is easier to control than the Windows sound mixer volume; e.g. you can use the synth settings ring. I don't really see a way we can support all of these different things at once when some of them are in conflict. I guess a setting might be possible, but these settings would have to be mutually exclusive, which is confusing at best. What synth are you using? I wonder whether the correct solution is to fix the synth driver to set the voice volume in a more useful way. |
Shure. I'm using the IBM TTS synthesizer. |
Okay. As a third party synth, we have no control over that. |
Exactly, I completely understand. That's why I was asking about a possibility to have the tones and the voice in the same session, so as not to have this kind of problems. Instead of having each session separately |
Which takes us back to people not being able to control them separately. |
Better solution for #1409. Addresses #14896 (comment). Also addresses feedback I received on Mastodon regarding the NVDA sounds volume not appearing in the Windows Volume Mixer in some versions of Windows. Summary of the issue: In Support for audio output using WASAPI #14697, I split NVDA speech and sounds into two separate Windows audio sessions to allow independent control of their levels. However, some users want these levels to be linked. In Add setting to have the volume of NVDA sounds follow the voice volume. #14896, I made it possible to have the sounds volume follow the voice volume. However, as per Add setting to have the volume of NVDA sounds follow the voice volume. #14896 (comment), some synths don't set the volume in a linear way, so the volumes don't match. It was reported to me on Mastodon that in Windows 11 Insider builds, the "NVDA sounds" volume doesn't show up in the Windows Volume Mixer unless you actively play a sound while the Volume Mixer is running. This is not very intuitive, and if this is behaviour Microsoft intends to keep, it isn't going to work well for our users. Having the volume of NVDA sounds controlled outside of NVDA is a little cumbersome. Description of user facing changes There will now only be one entry for NVDA in the Windows Volume Mixer which will control all NVDA audio. There will be a slider in NVDA Advanced Settings to control the volume of sounds. Description of development approach Removed the ability to set a WASAPI session and volume. Added a method to set the volume of a stream. This also allows you to set the volume of individual channels, though that's not used yet. Added a slider in Advanced Settings to control the volume of NVDA sounds. This is disabled if the sound volume is following the voice volume.
Changes to handle #15150 Follow up to #14697, #14896, #15038, #15097, #15145 Summary of the issue: WASAPI usage is known to cause intermittent crashing in #15150. Generally, WASAPI code has not been proven to be stable. Due to this, it should not be enabled by default in 2023.2. WASAPI can be re-enabled by default once it is proven to be stable. Description of user facing changes Disable WASAPI by default, preventing intermittent crashing #15150 Description of development approach Turn the WASAPI checkbox into a feature flag, so that it can easily be re-enabled in future. Testing strategy: Manual testing Upgrading the profile: Test starting NVDA with the WASAPI config value set to "True/False" instead of a "enabled/disabled/default". Test the various controls related to WASAPI - ensure they are saved, applied and respected correctly.
Link to issue number:
Fixes #1409.
Summary of the issue:
Users would like to be able to control the volume of NVDA sounds. With the WASAPI implementation in #14697, it is possible to separately control the volume of NVDA sounds using the Windows Volume Mixer. However, it is often useful to link the volume of NVDA sounds to the volume of the voice.
Description of user facing changes
It is now possible to have the volume of NVDA sounds and beeps follow the volume setting of the voice you are using. This option can be enabled in Advanced settings.
Description of development approach
When this option is enabled and a WasapiWavePlayer is using soundsSession, the open() and stop() methods of WasapiWavePlayer set the session volume to the synth's voice volume. Note that we do this in stop() because some players keep the device open; e.g. tones.
Testing strategy:
Known issues with pull request:
Change log entries:
New features
Note that I forgot to mention that it's possible to separately control the volume of NVDA sounds in the What's New for #14697. We could add that too:
Code Review Checklist: