nvda
e5c8bb24 - Fix SAPI4 WASAPI implementation (#17762)

Commit
321 days ago
Fix SAPI4 WASAPI implementation (#17762) Fixes #17755. Fixes #17756. Summary of the issue: Some SAPI4 voices fail to load with 'NoneType' object has no attribute 'setVolume'. Some SAPI4 voices such as TruVoice stopped producing sound, with no error sound or log generated. Some SAPI4 voices work, but cause errors to be logged continuously. Description of user facing changes The issues mentioned above should be fixed. Description of development approach Check if self._player is None before setting the volume level in IAudio_LevelSet, as some voices call LevelSet before calling Claim to initialize the audio device. Made IAudioDest_FreeSpace return a bigger buffer free space. Although the "free space" is actually unlimited and a fixed size of 200ms was used, 200ms is too small for some voices to send the first audio chunk, and therefore the voice will wait indefinitely for the free space to grow, which never happens. So the free space is now changed to be 2 seconds long, the minimum requirement in SAPI4 documentation. Failure HRESULT codes returned from _self.notifySink should be ignored, according to the SAPI4 documentation. Those are now ignored so that no errors will be logged.
Author
Parents
Loading