Options
All
  • Public
  • Public/Protected
  • All
Menu

An AudioSource component plays back one audio clip at a time. Multiple audio sources can play at the same time. To start playback use the AudioSourceStart component. To stop playback use the AudioSourceStop component.

Hierarchy

Index

Constructors

constructor

  • new AudioSource(clip?: Entity, volume?: number, loop?: boolean, playing?: boolean): AudioSource
  • Parameters

    • Optional clip: Entity
    • Optional volume: number
    • Optional loop: boolean
    • Optional playing: boolean

    Returns AudioSource

Properties

clip

clip: Entity

Specifies the audio clip that plays when this source starts playing. The clip entity must have the AudioClip component attached. If you change the clip entity, the change only takes effect after you attach an AudioSourceStart component to start playback.

loop

loop: boolean

If true, replays the audio clip when it reaches end. If you change the loop state, the change takes effect after you attach an AudioSourceStart component to start playback.

playing

playing: boolean

True if the audio clip is currently playing.

volume

volume: number

Specifies the audio clip's playback volume. Values can range from 0..1. If you change the volume, the change takes effect after you attach an AudioSourceStart component to start playback.

Static _isSharedComp

_isSharedComp: boolean

Static _size

_size: number

Static _view

_view: any

Static cid

cid: number

Static clip

clip: EntityComponentFieldDesc

Static loop

Static playing

Static volume

Methods

Static _dtorFn

  • Parameters

    Returns void

Static _fromPtr

Static _tempHeapPtr

  • Parameters

    Returns number

Static _toPtr

  • Parameters

    Returns void

Generated using TypeDoc