Skip to content

WASAPI: Track the total number of frames buffered so far rather than the duration of audio.#15745

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
jcsteh:sentFrames
Nov 6, 2023
Merged

WASAPI: Track the total number of frames buffered so far rather than the duration of audio.#15745
seanbudd merged 1 commit into
nvaccess:masterfrom
jcsteh:sentFrames

Conversation

@jcsteh

@jcsteh jcsteh commented Nov 6, 2023

Copy link
Copy Markdown
Contributor

Link to issue number:

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.

Testing strategy:

Set synth to eSpeak, rate boost enabled, rate 40.

Spelled the following line of text:

Another way to detect if this issue will occur is, at the noted rate values I posted above, spell a

Before this change, the pauses between characters would get faster and faster. After this change, the pauses are consistent.

Known issues with pull request:

None.

Code Review Checklist:

  • Documentation:
    • Change log entry
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English
  • API is compatible with existing add-ons.
  • Security precautions taken.

@jcsteh jcsteh requested a review from a team as a code owner November 6, 2023 00:43
@jcsteh jcsteh requested a review from seanbudd November 6, 2023 00:43
@seanbudd seanbudd merged commit 67d7c54 into nvaccess:master Nov 6, 2023
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Nov 6, 2023
@jcsteh jcsteh deleted the sentFrames branch May 25, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eSpeak and Say All running sentences together in NVDA 2023.3

3 participants