Skip to content

Fix MathCAT pauses at rate 0 and with eSpeak rate boost on - #21019

Open
tareh7z wants to merge 2 commits into
nvaccess:masterfrom
tareh7z:fix-mathcat-zero-speech-rate
Open

tareh7z wants to merge 2 commits into
nvaccess:masterfrom
tareh7z:fix-mathcat-zero-speech-rate

Conversation

@tareh7z

@tareh7z tareh7z commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #19894

Summary of the issue:

MathCAT scales the duration of its pauses by the synthesizer rate, but ignored rate boost, so pauses were as long with rate boost on as off.

With the speech rate at 0%, this also raised a division by zero error.

Description of user facing changes:

MathCAT no longer fails at a 0% speech rate, and its pauses are shorter when eSpeak rate boost is enabled.

Description of developer facing changes:

None.

Description of development approach:

The wpm value in convertSSMLTextForNVDA is multiplied by the synth's RATE_BOOST_MULTIPLIER when rate boost is on, and clamped to at least 2 so rate 0 behaves like rate 1.

Only eSpeak defines this multiplier, so other synths are unchanged.

Testing strategy:

Added unit tests for rate 0, for rate boost, and for a synth without a boost multiplier; they pass together with the rest of the unit test suite (1475 tests, 5 skipped).

Known issues with pull request:

Pauses are not adjusted for rate boost in OneCore and SAPI5, since they have no fixed boost factor.

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.

@tareh7z
tareh7z requested a review from a team as a code owner October 16, 2026 11:29
@tareh7z
tareh7z requested a review from seanbudd October 16, 2026 11:29
@tareh7z tareh7z closed this Oct 16, 2026
@tareh7z
tareh7z force-pushed the fix-mathcat-zero-speech-rate branch from b0fa5ed to 2843e70 Compare October 16, 2026 11:49
@tareh7z tareh7z reopened this Oct 16, 2026

@seanbudd seanbudd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes #19894 right?

@tareh7z tareh7z changed the title Fix MathCAT division by zero when speech rate is 0% Fix MathCAT pauses at rate 0 and with eSpeak rate boost on Oct 17, 2026
@tareh7z

tareh7z commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

This fixes #19894 right?

Oh, yes! It fixes #19894, sorry for not linking it earlier. I have updated the PR to also cover the rate boost part.

This branch has not been deployed

No deployments
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.

Inconsistency or error in MathCAT pause

2 participants