Skip to content

Fix issue with Tone mode not using the correct frequency on page load#4

Open
schui wants to merge 1 commit into
headphonejames:masterfrom
schui:master
Open

Fix issue with Tone mode not using the correct frequency on page load#4
schui wants to merge 1 commit into
headphonejames:masterfrom
schui:master

Conversation

@schui

@schui schui commented Mar 13, 2025

Copy link
Copy Markdown

Fixes #3 Wrong frequency in tone mode when page is left open for a while

@schui

schui commented Mar 13, 2025

Copy link
Copy Markdown
Author

If you fresh load the page and never change the frequency, Tone mode plays constants.DEFAULT_FREQ instead of the selected frequency. If the tab is left open for a while, and is discarded by the browser, then it also acts like it is a fresh load. You can force a discard with chrome://discards/

Steps:

  1. Open the page, change the frequency to something that isn't 1000hz
  2. Close the page
  3. Reopen the page, click Play Tone
  4. The page plays the wrong tone.

@headphonejames headphonejames left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM! Thanks

@schui

schui commented Mar 13, 2025

Copy link
Copy Markdown
Author

Thanks for reviewing the change!

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.

Wrong frequency in tone mode when page is left open for a while

2 participants