PitchDetector
Detects the fundamental pitch (f0) of the audio source in real time.
| Type | Name | Interface Description |
|---|---|---|
| Functions | constructor() | |
| Functions | getResult(): number | • Function: Gets the current pitch detection result. The value represents the detected fundamental frequency in Hz. A larger value means a higher pitch. Returns The detected pitch in Hz, in the range [45, 650]. Returns -1 when no pitch is detected (e.g., during silence or non-pitched noise). |
Examples
constructor()
let obj = new APJS.PitchDetector();
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use PitchDetector here
}
onUpdate(deltaTime: number) {
}
}