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

Which format and size does the Float32Array has to have for good detecetion ? #45

Open
hamza-eljaouhari opened this issue Feb 24, 2021 · 2 comments

Comments

@hamza-eljaouhari
Copy link

hamza-eljaouhari commented Feb 24, 2021

Hello,

I have tried the package by sending captured streams of audio from the browser to a socket.io server trying to execute the algorithms to detect pitches and compare them with a table of musical frequencies.

I have tried all 3 of the algorithms but the result is always null.

const a = Pitchfinder.AMDF(); const b = Pitchfinder.YIN(); const c = Pitchfinder.DynamicWavelet(); console.log([a(float32Array), b(float32Array), c(float32Array)]);

I'm also streaming a Float32Array with the size of 1024.

All I receive is :

[null, null, null]

Thank you

@hamza-eljaouhari hamza-eljaouhari changed the title Which format and size does the Float32Array has to have for good detecetion; Which format and size does the Float32Array has to have for good detecetion ? Feb 24, 2021
@peterkhayes
Copy link
Owner

I wonder if your Float32Arrays are long enough to get a good pitch reading? 1024 samples is around 0.02 seconds.

@RemyNtshaykolo
Copy link

Hi I struggled also to make it work but here are my setting.

const options: Options = {
  sampleRate: 44100
  channels: 1
  bitsPerSample: 8
  audioSource: 6
  bufferSize: 1024
  wavFile: '',
};

const detectPitch = YIN({sampleRate: 44100});

I tried 32,16 bitsPerSample but the YIN was only returning null values with 8 bits it work perfectly fine

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

3 participants