question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Could not find enough samples for a reliable detection.

See original GitHub issue

I’m trying to connect it to a live radio stream but it just keeps throwing that error. is there a way to do this with a live feed?

  getBPM = () => {
    console.log("bpm");
    let { source } = this.state;
    let audioContext = this.props.audioContext;
    const scriptProcessorNode = audioContext.createScriptProcessor(4096, 1, 1);
    scriptProcessorNode.connect(audioContext.destination);
    source.connect(scriptProcessorNode);

    const onAudioProcess = new RealTimeBPMAnalyzer({
      debug: true,
      scriptNode: {
        bufferSize: 4096,
        numberOfInputChannels: 1,
        numberOfOutputChannels: 1,
      },
      pushTime: 1000,
      pushCallback: (err, bpm) => {
        console.log("65", err);
        console.log("bpm", bpm);
      },
    });
    scriptProcessorNode.onaudioprocess = (e) => {
      onAudioProcess.analyze(e);
    };
  };

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dlepauxcommented, Oct 29, 2021

FYI I’ve implemented a solution with the new unreleased version of the library. I will keep you in touch when it will be.

0reactions
dlepauxcommented, Nov 16, 2021

I just released the version 2.1.1 (https://www.npmjs.com/package/realtime-bpm-analyzer/v/2.1.1) 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do When Your Sample Size is Not Big Enough
In real world research, sometimes your sample size is not big enough. This is what you do when you can't achieve the necessary...
Read more >
Understanding the relevance of sample size calculation - PMC
A smaller sample will give a result which may not be sufficiently powered to detect a difference between the groups and the study...
Read more >
Too Much or Not Enough: Sample Sizes and Statistical Analysis
The Type I error is the error of detecting a negligible difference. This error is considered the false positive rate, the producer's risk...
Read more >
Sample Size Calculation with R
'just right'. • The answer: Sample Size Calculation. • Goal: We strive to have enough samples to reasonably detect an effect if it...
Read more >
How to Determine the Correct Sample Size - Qualtrics
Instantly calculate your ideal sample size with our free-to-use tool and learn the math and methodology behind the process. ✓ Learn more today!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found