rapper-audio
v0.0.2
Published
Wrapper for simple audio playing.
Downloads
7
Maintainers
Readme
Rapper
Still WIPsh
Simple interface for playing audio in browser.
API
let options = {volume: Number, sounds: Object}
let rapper = new Rapper(Object options)
rapper.init()
rapper.play(String soundName)
rapper.volume(number [0,1])
rapper.unload()
Example:
let rapper = new Rapper({
volume: 0.5,
sounds: {
click: "./click.mp3",
wilhelmScream: "./scream.mp3"
}
})
...
rapper.init()
...
rapper.play("click")
...
rapper.play("wilhelmScream")
TODO
- [ ] Make sure the
<audio>
player works - [ ]
unload
- [ ] Volume change on the fly and possibility to play multiple audios simultaneously?
- [ ] base64 and other formats?