Browser Audio
A simple cross-browser audio player. Uses Web Audio when possible (except in Firefox where HTML5 <audio>
works better) and falls back to HTML5 <audio>
. Supports IE10+ and most mobile browsers.
The file formats supported depend on the underlying Browser implementation, but .mp3
should work in most situations.
Note this library is only intended for playing multiple small sound effects, there's no streaming support for large files.
Usage
npm install browser-audio
var audio =var file = audiofile // plays when loaded// or...// files are instances of EventEmitterfile// other methods/properties:filefilestate // 'loading' or 'loaded'filedurationfilecurrentTime// multiple file load helpervar file1 = audiovar file2 = audioaudio
License
MIT