@patomation/sound

A Javascript sound manager library

Usage no npm install needed!

<script type="module">
  import patomationSound from 'https://cdn.skypack.dev/@patomation/sound';
</script>

README

Sound

a JavaScript sound manager library

A way to play multiple sounds at once, the ability to stop them from playing. Nice sound fade out when stopping instead of abruptly ending.

Installation

npm install @patomation/sound

or

yarn install @patomation/sound

Usage

import sound from '@patomation/sound'

sound.add('mysoundID', 'pathToSound/mysound.mp3')

sound.player.play('mysoundID')

Stopping the sound

sound.player.stop('mysoundID')

Setting master volume

sound.player.volume(0.6)

Removing a sound

sound.remove('mysoundID')