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

ReferenceError: clearTimeout is not defined #49

Closed
evoyy opened this issue Mar 31, 2023 · 2 comments
Closed

ReferenceError: clearTimeout is not defined #49

evoyy opened this issue Mar 31, 2023 · 2 comments

Comments

@evoyy
Copy link

evoyy commented Mar 31, 2023

I'm trying to get this working with my React app and I am running into the following issue.

I copied ./node_modules/realtime-bpm-analyzer/dist/realtime-bpm-processor.js into my public directory and followed the steps in the Continuous Analysis strategy.

Upon activation, I'm seeing the following error repeating in the console:

realtime-bpm-processor.js:330 ReferenceError: clearTimeout is not defined
    at RealTimeBpmAnalyzer.<anonymous> (realtime-bpm-processor.js:260:11)
    at Generator.next (<anonymous>)
    at fulfilled (realtime-bpm-processor.js:7:26)

Screenshot 2023-04-01 002226

After learning about Audio Worklets, I think this might be a bug. If my understanding is correct, the processor runs in a separate execution context and does not have access to the DOM, therefore setTimeout/clearTimeout will not be available to the processor. Instead, the main thread has to be responsible for managing timers and triggering the stabilization by communicating with the worklet.

@dlepaux dlepaux closed this as completed in 50f0a8b Apr 1, 2023
@dlepaux
Copy link
Owner

dlepaux commented Apr 1, 2023

Hi @evoyy ! Thank you for the bug report. I've patched the issue and released the version 3.1.5 that includes the bugfix.

@dlepaux dlepaux reopened this Apr 1, 2023
@dlepaux dlepaux closed this as completed Apr 1, 2023
@evoyy
Copy link
Author

evoyy commented Apr 2, 2023

I confirm it is working. Thanks for the quick fix.

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

No branches or pull requests

2 participants