Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix speech delay caused by audio ducking #17806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gexgd0419
Copy link
Contributor

Link to issue number:

Fixes #17798, introduced by #17770.

Summary of the issue:

When audio ducking is enabled, the delay before each utterance increases significantly.

Description of user facing changes

The delay should return to a normal level compared to unaffected alpha versions.

Description of development approach

Instead of calling _setDuckingState to notify the system each time _ensureDucked is called, check the time passed since the last ducking to limit "redundant" calls to _setDuckingState to at most once per second. This prevents the delay caused by calling _setDuckingState too many times, but still allow audio ducking state to be reset when the next utterance starts more than one second later.

Testing strategy:

Tested manually.

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.

@coderabbitai summary

@gexgd0419 gexgd0419 marked this pull request as ready for review March 9, 2025 15:50
@gexgd0419 gexgd0419 requested a review from a team as a code owner March 9, 2025 15:50
@gexgd0419 gexgd0419 requested a review from seanbudd March 9, 2025 15:50
@gexgd0419 gexgd0419 marked this pull request as draft March 9, 2025 16:11
@gexgd0419 gexgd0419 marked this pull request as ready for review March 10, 2025 02:02
@gexgd0419
Copy link
Contributor Author

Please check the discussion in #17798 first.

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.

Noticeable lag when enabling audio ducking
1 participant