SoundEventDetector
Sound event detector.
| Type | Name | Interface Description |
|---|---|---|
| Variables | enabled: boolean | • Function: Whether the detector is enabled. |
| Functions | constructor() | |
| Functions | getResult(): SoundEventResult[] | • Function: get sound event detection result |
| Functions | getSimilarityByType(type: SoundEventType): number | • Function: get similarity of specific sound event type |
Examples
enabled: boolean
this.audioEventDetector.enabled = false;
constructor()
let obj = new APJS.SoundEventDetector();
getResult(): SoundEventResult[]
const results = this.audioEventDetector.getResult();
for (const result of results) {
console.log(result.type, result.similarity);
}
getSimilarityByType(type: SoundEventType): number
const catResult = this.audioEventDetector.getSimilarityByType(APJS.SoundEventType.Cat);
console.log(catResult);
Use Case
@component()
export class NewBehaviourScript extends APJS.BasicScriptComponent {
onStart() {
// TODO: instantiate / use SoundEventDetector here
}
onUpdate(deltaTime: number) {
}
}