Skip to main content

PitchDetector

Detects the fundamental pitch (f0) of the audio source in real time.

TypeNameInterface Description
Functionsconstructor()

FunctionsgetResult(): 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) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies