Skip to main content

AudioDetectionModule

The module for audio detection to get the builder for the specified audio detection type.

TypeNameInterface Description
Static FunctionsgetOrCreateAudioDetectionBuilder(type: AudioDetectionType): AudioDetectorBuilder<any> | null

Function: Get the builder for the specified audio detection type. Should be called in the onInit method.

Parameters

type: The audio detection type.

Returns The builder for the specified audio detection type.

Examples

getOrCreateAudioDetectionBuilder(type: AudioDetectionType): AudioDetectorBuilder<any> | null

onInit(): void {
const audioDetectionBuilder = APJS.AudioDetectionModule.getOrCreateAudioDetectionBuilder(APJS.AudioDetectionType.SoundEvent);
audioEventDetector = audioDetectionBuilder.build();
}

Use Case

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