WeightedSound

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

Hierarchy

  • WeightedSound

Index

Constructors

constructor

Find examples in Playground
  • 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

directionalConeInnerAngle

Find examples in Playground
directionalConeInnerAngle: number

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

directionalConeOuterAngle

Find examples in Playground
directionalConeOuterAngle: 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.

isPaused

Find examples in Playground
isPaused: boolean

A Sound is currently paused.

isPlaying

Find examples in Playground
isPlaying: boolean

A Sound is currently playing.

loop

Find examples in Playground
loop: boolean

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

volume

Find examples in Playground
volume: number

Playback volume.

Methods

pause

Find examples in Playground
  • pause(): void
  • Suspend playback

    Returns void

play

Find examples in Playground
  • play(startOffset?: number): void
  • Start playback.

    Parameters

    • Optional startOffset: number

      Position the clip head at a specific time in seconds.

    Returns void

stop

Find examples in Playground
  • stop(): void
  • Stop playback

    Returns void

Generated using TypeDoc