UNPKG

@needle-tools/engine

Version:

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development with great integrations into editors like Unity or Blender - and can be deployed onto any device! It is flexible, extensible and networking and XR are built-in.

34 lines (33 loc) 1.25 kB
import { AudioListener as ThreeAudioListener } from "three"; import { Behaviour } from "./Component.js"; /** * AudioListener represents a listener that can hear audio sources in the scene. * This component creates and manages a Three.js {@link three#AudioListener}, automatically connecting it * to the main camera or a Camera in the parent hierarchy. * @category Multimedia * @group Components */ export declare class AudioListener extends Behaviour { /** * Gets the existing Three.js {@link three#AudioListener} instance or creates a new one if it doesn't exist. * This listener is responsible for capturing audio in the 3D scene. * @returns The {@link three#AudioListener} instance */ get listener(): ThreeAudioListener; private _listener; /** * Registers for interaction events and initializes the audio listener * when this component is enabled. * @internal */ onEnable(): void; /** * Cleans up event registrations and removes the audio listener * when this component is disabled. * @internal */ onDisable(): void; private onInteraction; private addListenerIfItExists; private removeListenerIfItExists; }