NVDA driver compatibility with NVDA 2025.1 and older - #917
Conversation
…stable versions of NVDA. From now, NVDA uses audio endpoints to store the audio device names. The compatibllity with previous NVDA versions is maintained.
|
instead of try except make condition for buildVersion and set corresponding config section. |
|
Thank you @beqabeqa473 |
|
Okay, done, and testd if it works. I have tested it on stable NVDA versions, as well as the versions in development. |
|
Yes, there is code repetition in creating nvwave player, make one field of config section like config.conf["audio"] and then in condition reassign it to config.conf["speech"] |
beqabeqa473
left a comment
There was a problem hiding this comment.
In SynthDriver class just before self.__player add line
self.outputDeviceSection = config.conf["speech"] if buildVersion.version_year < 2025 else config.conf["audio"]
in AudioPlayer class, where you made changes, remove them and add
player = nvwave.WavePlayer(channels=1, samplesPerSec=self.__sample_rate, bitsPerSample=16, outputDevice=self.synth.outputDeviceSection["outputDevice"])
Please test changes before committing as i might have some typoes because i am writing from phone.
|
Okay. Resolved, thank you! |
context
In the future NVDA 2025.1, audio devices in the NVDA user configuration will be stored as endpoint Ids instead of friendly names.
development strategy:
Changed the audio device lookup and selection strategy. We are trying two approaches: one from the old stable NVDA, and one which will be introduced in 2025.1
So, in the synth driver, we are using the following statements:
try:
player = nvwave.WavePlayer(channels=1, samplesPerSec=self.__sample_rate, bitsPerSample=16, outputDevice=config.conf["speech"]["outputDevice"])
except:
player = nvwave.WavePlayer(channels=1, samplesPerSec=self.__sample_rate, bitsPerSample=16, outputDevice=config.conf["audio"]["outputDevice"])
So, from now on, the new key for the ouptput device is not located in speech, but in audio, and I am maintaining the backwards compatibility, as seen in the above try/except block.
testing strategy:
This fix was tested on the current stable NVDA version, 2024.1.0, as well as on the latest alpha version, from which the NVDA 2025.1 release is developing
nvaccess/nvda#17547