Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WeightedSound

Wraps one or more Sound objects and selects one with random weight for playback.

Hierarchy

  • WeightedSound

Index

Constructors

constructor

  • Creates a new WeightedSound from the list of sounds given.

    Parameters

    • loop: boolean

      When true a Sound will be selected and played when the current playing Sound completes.

    • sounds: Sound[]

      Array of Sounds that will be selected from.

    • weights: number[]

      Array of number values for selection weights; length must equal sounds, values will be normalized to 1

    Returns WeightedSound

Properties

isPausedSearch playground for isPaused

isPaused: boolean

A Sound is currently paused.

isPlayingSearch playground for isPlaying

isPlaying: boolean

A Sound is currently playing.

loopSearch playground for loop

loop: boolean

When true a Sound will be selected and played when the current playing Sound completes.

Accessors

directionalConeInnerAngle

  • get directionalConeInnerAngle(): number
  • set directionalConeInnerAngle(value: number): any
  • The size of cone in degrees for a directional sound in which there will be no attenuation.

    Returns number

  • The size of cone in degrees for a directional sound in which there will be no attenuation.

    Parameters

    • value: number

    Returns any

directionalConeOuterAngle

  • get directionalConeOuterAngle(): number
  • set directionalConeOuterAngle(value: number): any
  • Size of cone in degrees for a directional sound outside of which there will be no sound. Listener angles between innerAngle and outerAngle will falloff linearly.

    Returns number

  • Size of cone in degrees for a directional sound outside of which there will be no sound. Listener angles between innerAngle and outerAngle will falloff linearly.

    Parameters

    • value: number

    Returns any

volume

  • get volume(): number
  • set volume(value: number): any
  • Playback volume.

    Returns number

  • Playback volume.

    Parameters

    • value: number

    Returns any

Methods

pauseSearch playground for pause

  • pause(): void
  • Suspend playback

    Returns void

playSearch playground for play

  • play(startOffset?: number): void
  • Start playback.

    Parameters

    • Optional startOffset: number

      Position the clip head at a specific time in seconds.

    Returns void

stopSearch playground for stop

  • stop(): void
  • Stop playback

    Returns void

Legend

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