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

Allow injection of PitchDetector into PitchProcessor. #215

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

Conversation

rohankhayech
Copy link

Added constructor with PitchDetector parameter to PitchProcessor, allowing the internal pitch detector used to be specified:

public PitchProcessor(PitchDetector detector, PitchDetectionHandler handler)

This allows the specific parameters of each pitch estimation algorithm to be specified when using the pitch processor.

For example the min and max frequency for AMDF:

PitchProcessor pitchProcessor = new PitchProcessor(
    AMDF(
        sampleRate,
        audioBufferSize,
        minFrequency,
        maxFrequency
    ),
    pitchDetectionHandler
)

The existing constructor is maintained to still allow ease of use by specifying the relevant enum to use the default parameters.

@C0urante
Copy link

I ended up forking locally in order to enable this exact thing! Would be nice to see in the upstream repo if one of the maintainers has time to review.

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.

2 participants