AudioJS is a agnostic and cross-browser library to work easily with the AudioContext API of HTML5.
AudioJS is compatible with the following browsers/version:
- Google Chrome 28.0+
- Firefox 25.0+
- Safari 6.0+
- IOS Safari 6.0-6.1+
- Opera 16.0+
- file
String
(undefined
by default) - autoPlay
Boolean
(false
by default) - loop
Boolean
(false
by default) - volume
Number
(Range 0-1,1
by default)
- audioJS.
play()
- audioJS.
stop()
Examples
var audio = window.audioJS({
file: 'audio.mp3'
});
audio.play();
window.setTimeout(function(){
audio.stop();
}, 4000);