patomation / sound

javascript web sound manager npm package

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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')

About

javascript web sound manager npm package


Languages

Language:JavaScript 100.0%