Options
All
  • Public
  • Public/Protected
  • All
Menu

A pool of sound objects to allow playing multiples of the same sound.

Example

const dings = new SoundPool('assets/sounds/ding.ogg')

// When the sound should play (and may already be playing).
dings.play()

Hierarchy

  • SoundPool

Index

Constructors

Methods

Constructors

constructor

  • Initialize SoundPool object.

    Parameters

    • src: string

      Source for the sound.

    • Default value poolSize: number = 3

      Number of sound instances in the pool.

    • Default value options: SoundOptions = { volume: 1, loop: false }

      Initial options for the sound.

    Returns SoundPool

Methods

play

stop

  • stop(): void