dot big bang

Developer API
Menu

Class SoundPositionalPlayback

All
  • Public
  • Public/Protected
  • All

Hierarchy

Index

Properties

Readonly position

position: Vector3

The world coordinate where the sound is emanating from. Can be modified, and the sound will move to the new position specified.

Accessors

finished

  • get finished(): boolean
  • true when the sound is no longer playing.

    Returns boolean

gain

  • get gain(): number
  • set gain(value: number): void
  • How loud the playing sound should be played. Ranges from 0 to 1 (inclusive).

    Returns number

  • How loud the playing sound should be played. Ranges from 0 to 1 (inclusive).

    Parameters

    • value: number

    Returns void

looping

  • get looping(): boolean
  • set looping(value: boolean): void
  • Whether the playing sound should loop when it finishes.

    Returns boolean

  • Whether the playing sound should loop when it finishes.

    Parameters

    • value: boolean

    Returns void

maxDistance

  • get maxDistance(): number
  • set maxDistance(value: number): void
  • Represents the maximum distance between the audio source and the listener, outside which the gain is not reduced any further. This property is only used when using SoundDistanceModel.Linear for distanceModel. Must be a positive non-zero number.

    Returns number

  • Represents the maximum distance between the audio source and the listener, outside which the gain is not reduced any further. This property is only used when using SoundDistanceModel.Linear for distanceModel. Must be a positive non-zero number.

    Parameters

    • value: number

    Returns void

pitch

  • get pitch(): number
  • set pitch(value: number): void
  • A pitch multiplier for the playing sound. 1.0 means normal pitch. Less than 1.0 is slower. Greater than 1.0 is faster. Valid values are in the range (0,8]. Zero is invalid (it would stop playback).

    Returns number

  • A pitch multiplier for the playing sound. 1.0 means normal pitch. Less than 1.0 is slower. Greater than 1.0 is faster. Valid values are in the range (0,8]. Zero is invalid (it would stop playback).

    Parameters

    • value: number

    Returns void

playing

  • get playing(): boolean
  • true when the sound is playing.

    Returns boolean

refDistance

  • get refDistance(): number
  • set refDistance(value: number): void
  • The distance from position within which the sound will be at normal gain. Must be a non-negative number.

    Returns number

  • The distance from position within which the sound will be at normal gain. Must be a non-negative number.

    Parameters

    • value: number

    Returns void

rolloffFactor

  • get rolloffFactor(): number
  • set rolloffFactor(value: number): void
  • Describes how quickly gain should be reduced when moving away from the listener. Its range depends on the distanceModel used (negative values are not allowed).

    • SoundDistanceModel.Linear: The range is 0 to 1.
    • SoundDistanceModel.Inverse: The range is 0 to Infinity.
    • SoundDistanceModel.Exponential: The range is 0 to Infinity.

    Returns number

  • Describes how quickly gain should be reduced when moving away from the listener. Its range depends on the distanceModel used (negative values are not allowed).

    • SoundDistanceModel.Linear: The range is 0 to 1.
    • SoundDistanceModel.Inverse: The range is 0 to Infinity.
    • SoundDistanceModel.Exponential: The range is 0 to Infinity.

    Parameters

    • value: number

    Returns void

Methods

stop

  • If a playing sound hasn't already finished, this function will stop it according to policy.

    Parameters

    • Optional policy: SoundStopPolicy

      If SoundStopPolicy.Immediate, will halt at the end of the current frame. If SoundStopPolicy.FinishLoop, the sound will finish playing the current (or only) loop. Default value: SoundStopPolicy.Immediate

    Returns void