AudioContext.js 342 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. var _context;
  5. var AudioContext = {
  6. getContext: function () {
  7. if ( _context === undefined ) {
  8. _context = new ( window.AudioContext || window.webkitAudioContext )();
  9. }
  10. return _context;
  11. },
  12. setContext: function ( value ) {
  13. _context = value;
  14. }
  15. };
  16. export { AudioContext };
粤ICP备19079148号