AudioContext.js 296 B

12345678910111213141516171819202122232425
  1. let _context;
  2. const AudioContext = {
  3. getContext: function () {
  4. if ( _context === undefined ) {
  5. _context = new ( window.AudioContext || window.webkitAudioContext )();
  6. }
  7. return _context;
  8. },
  9. setContext: function ( value ) {
  10. _context = value;
  11. }
  12. };
  13. export { AudioContext };
粤ICP备19079148号