Skip to content
프로젝트

소개

Pitch detection in JavaScript

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
기록 수집 중
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

pitch.js

pitch.js is a pitch detection library written in JavaScript. It is based on the excellent code used in performous. While mainly aimed for human voice, it can also be used with other instruments.

Usage

For pitch.js to work, you'll also need to include fft.js.

pitch.js ships one namespace, called PitchAnalyzer from which all the functionality is available:


/* Create a new pitch detector */
var pitch = new PitchAnalyzer(sampleRate);

/* Copy samples to the internal buffer */
pitch.input(audioBuffer);
/* Process the current input in the internal buffer */
pitch.process();

var tone = pitch.findTone();

if (tone === null) {
	console.log('No tone found!');
} else {
	console.log('Found a tone, frequency:', tone.freq, 'volume:', tone.db);
}

Notes

  • The audioBuffer must be mono.
  • The internal buffer is 4096 samples long, so if you input more than that without processing in between, you might get incorrect results.

Authors

pitch.js is brought to you by Audiocogs. Please see ./docs/AUTHORS.md for more details.

License

This code is ported from original C++ code by Lasse Kärkkäinen, hence licensed under GPLv2, as is the original. Please see pitch.js/docs/LICENSE.txt for further information.

관련 프로젝트 살펴보기

불러오는 중…