AudioDetectionModule
The module for audio detection to get the builder for the specified audio detection type.
| Type | Name | Interface Description |
|---|---|---|
| Static Functions | getOrCreateAudioDetectionBuilder(type: AudioDetectionType): AudioDetectorBuilder<any> | null | • Function: Get the builder for the specified audio detection type. Should be called in the onInit method. Parameters • 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) {
}
}