Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AudioSceneComponent

Defines the sound scene component responsible to manage any sounds in a given scene.

Hierarchy

  • AudioSceneComponent

Implements

Index

Constructors

constructor

  • Creates a new instance of the component for the given scene

    Parameters

    • Optional scene: Nullable<Scene>

      Defines the scene to register the component in

    Returns AudioSceneComponent

Properties

audioPositioningRefreshRateSearch playground for audioPositioningRefreshRate

audioPositioningRefreshRate: number

Gets or sets a refresh rate when using 3D audio positioning

Readonly nameSearch playground for name

name: "Audio" = "Audio"

The component name helpful to identify the component in the list of scene components.

sceneSearch playground for scene

scene: Scene

The scene the component belongs to.

Accessors

audioEnabled

  • get audioEnabled(): boolean
  • Gets whether audio is enabled or not. Please use related enable/disable method to switch state.

    Returns boolean

audioListenerPositionProvider

  • Gets the current audio listener position provider

    Returns Nullable<() => Vector3>

  • Sets a custom listener position for all sounds in the scene By default, this is the position of the first active camera

    Parameters

    Returns any

headphone

  • get headphone(): boolean
  • Gets whether audio is outputting to headphone or not. Please use the according Switch methods to change output.

    Returns boolean

Methods

addFromContainerSearch playground for addFromContainer

disableAudioSearch playground for disableAudio

  • disableAudio(): void
  • Disables audio in the associated scene.

    Returns void

disposeSearch playground for dispose

  • dispose(): void

enableAudioSearch playground for enableAudio

  • enableAudio(): void
  • Enables audio in the associated scene.

    Returns void

rebuildSearch playground for rebuild

  • rebuild(): void
  • Rebuilds the elements related to this component in case of context lost for instance.

    Returns void

registerSearch playground for register

  • register(): void

removeFromContainerSearch playground for removeFromContainer

  • removeFromContainer(container: AbstractScene, dispose?: boolean): void
  • Removes all the elements in the container from the scene

    Parameters

    • container: AbstractScene

      contains the elements to remove

    • Optional dispose: boolean

      if the removed element should be disposed (default: false)

    Returns void

serializeSearch playground for serialize

  • serialize(serializationObject: any): void
  • Serializes the component data to the specified json object

    Parameters

    • serializationObject: any

      The object to serialize to

    Returns void

switchAudioModeForHeadphonesSearch playground for switchAudioModeForHeadphones

  • switchAudioModeForHeadphones(): void
  • Switch audio to headphone output.

    Returns void

switchAudioModeForNormalSpeakersSearch playground for switchAudioModeForNormalSpeakers

  • switchAudioModeForNormalSpeakers(): void
  • Switch audio to normal speakers.

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Static property
  • Static method