Skip to main content

VolumeDetector

Detects the overall volume level of the audio source in real time.

TypeNameInterface Description
Functionsconstructor()

FunctionsgetResult(): number

Function: Gets the current volume detection result.

Returns A normalized volume value in the range [0, 1], or -1 when no result is available.

Examples

constructor()

let obj = new APJS.VolumeDetector();

Use Case

@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use VolumeDetector here
}
onUpdate(deltaTime: number) {
}
}
Copyright © 2026 TikTok. All rights reserved.
About TikTokHelp CenterCareersContactLegalTerms of ServicePrivacy PolicyCookies