rapper-audio

0.0.2 • Public • Published

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?

Package Sidebar

Install

npm i rapper-audio

Weekly Downloads

0

Version

0.0.2

License

MIT

Last publish

Collaborators

  • silppuri