dist/howler.js
function() {
      var self = this;

      if (!self.ctx || typeof self.ctx.resume === 'undefined' || !Howler.usingWebAudio) {
        return;
      }

      if (self.state === 'running' && self._suspendTimer) {
        clearTimeout(self._suspendTimer);
        self._suspendTimer = null;
      } else if (self.state === 'suspended') {
        self.ctx.resume().then(function() {
          self.state = 'running';

          // Emit to all Howls that the audio has resumed.
          for (var i=0; i<self._howls.length; i++) {
            self._howls[i]._emit('resume');
          }
        });

        if (self._suspendTimer) {
          clearTimeout(self._suspendTimer);
          self._suspendTimer = null;
        }
      } else if (self.state === 'suspending') {
        self._resumeAfterSuspend = true;
      }

      return self;
    }
function() {
      var self = this;

      if (!self.ctx || typeof self.ctx.resume === 'undefined' || !Howler.usingWebAudio) {
        return;
      }

      if (self.state === 'running' && self._suspendTimer) {
        clearTimeout(self._suspendTimer);
        self._suspendTimer = null;
      } else if (self.state === 'suspended') {
        self.ctx.resume().then(function() {
          self.state = 'running';

          // Emit to all Howls that the audio has resumed.
          for (var i=0; i<self._howls.length; i++) {
            self._howls[i]._emit('resume');
          }
        });

        if (self._suspendTimer) {
          clearTimeout(self._suspendTimer);
          self._suspendTimer = null;
        }
      } else if (self.state === 'suspending') {
        self._resumeAfterSuspend = true;
      }

      return self;
    }
function ( ) { var self = this ; if ( ! self . ctx || typeof self . ctx . resume === 'undefined' || ! Howler . usingWebAudio ) { return ; } if ( self . state === 'running' && self . _suspendTimer ) { clearTimeout ( self . _suspendTimer ) ; self . _suspendTimer = null ; } else if ( self . state === 'suspended' ) { self . ctx . resume ( ) . then ( function ( ) { self . state = 'running' ; // Emit to all Howls that the audio has resumed. for ( var i = 0 ; i < self . _howls . length ; i ++ ) { self . _howls [ i ] . _emit ( 'resume' ) ; } } ) ; if ( self . _suspendTimer ) { clearTimeout ( self . _suspendTimer ) ; self . _suspendTimer = null ; } } else if ( self . state === 'suspending' ) { self . _resumeAfterSuspend = true ; } return self ; }
Automatically resume the Web Audio AudioContext when a new sound is played.
@return {Howler}
Automatically resume the Web Audio AudioContext when a new sound is played .