nvda
67d7c54f - WASAPI: Track the total number of frames buffered so far rather than the duration of audio. (#15745)

Commit
2 years ago
WASAPI: Track the total number of frames buffered so far rather than the duration of audio. (#15745) Fixes #15739. Summary of the issue: When there are several consecutive utterances of speech such as during say all or spelling, the pauses between utterances gradually decrease over time. Description of user facing changes When using say all or commands which spell text, pauses between sentences or characters no longer gradually decrease over time. Description of development approach Previously, the WASAPI code accumulated the total duration of ms buffered so far. To do this, we converted from the number of frames sent to ms and added that to the total ms. This conversion isn't perfect, which meant we continually accumulated conversion errors. This resulted in the callbacks gradually getting ever more inaccurate (earlier) until the stream was stopped and reset. Instead, we now accumulate the total number of frames sent. We still convert to ms, since the current playback position is time-based. However, we only convert to ms on demand, so we don't accumulate conversion errors.
Author
Parents
Loading