Skip to content
Harsh Singh edited this page Jan 13, 2024 · 6 revisions

play()

Params

  • arrayBuffer - sound to play
  • time {number} - time to skip and play from
  • loop {boolean} - loop the sound
  • gainNode

Example

Bottlecap.Sound.play(assets.sound.bgm, 0, true, soundMixer);

setVolume()

Params

  • gainNode
  • volume {number} - 1 - full volume 0 - mute

Example

Bottlecap.Sound.setVolume(.5, soundMixer);

stop()

Params

  • source - sound
  • time {number} - time to wait

Example

const source = Bottlecap.Sound.play(assets.sound.bgm, 0, true, soundMixer);
Bottlecap.Sound.stop(source);
Clone this wiki locally