fireball/lib/audio/AudioContext.js

30 lines
337 B
JavaScript
Raw Normal View History

2018-12-25 13:59:22 +00:00
/**
* @author mrdoob / http://mrdoob.com/
*/
var context;
var AudioContext = {
getContext: function () {
if ( context === undefined ) {
context = new ( window.AudioContext || window.webkitAudioContext )();
}
return context;
},
setContext: function ( value ) {
context = value;
}
};
export { AudioContext };