function() {
      var self = this;
      var url = null;

      // If no audio is available, quit immediately.
      if (Howler.noAudio) {
        self._emit('loaderror', null, 'No audio support.');
        return;
      }

      // Make sure our source is in an array.
      if (typeof self._src === 'string') {
        self._src = [self._src];
      }

      // Loop through the sources and pick the first one that is compatible.
      for (var i=0; i<self._src.length; i++) {
        var ext, str;

        if (self._format && self._format[i]) {
          // If an extension was specified, use that instead.
          ext = self._format[i];
        } else {
          // Make sure the source is a string.
          str = self._src[i];
          if (typeof str !== 'string') {
            self._emit('loaderror', null, 'Non-string found in selected audio sources - ignoring.');
            continue;
          }

          // Extract the file extension from the URL or base64 data URI.
          ext = /^data:audio\/([^;,]+);/i.exec(str);
          if (!ext) {
            ext = /\.([^.]+)$/.exec(str.split('?', 1)[0]);
          }

          if (ext) {
            ext = ext[1].toLowerCase();
          }
        }

        // Log a warning if no extension was found.
        if (!ext) {
          console.warn('No file extension was found. Consider using the "format" property or specify an extension.');
        }

        // Check if this extension is available.
        if (ext && Howler.codecs(ext)) {
          url = self._src[i];
          break;
        }
      }

      if (!url) {
        self._emit('loaderror', null, 'No codec support for selected audio sources.');
        return;
      }

      self._src = url;
      self._state = 'loading';

      // If the hosting page is HTTPS and the source isn't,
      // drop down to HTML5 Audio to avoid Mixed Content errors.
      if (window.location.protocol === 'https:' && url.slice(0, 5) === 'http:') {
        self._html5 = true;
        self._webAudio = false;
      }

      // Create a new sound object and add it to the pool.
      new Sound(self);

      // Load and decode the audio data for playback.
      if (self._webAudio) {
        loadBuffer(self);
      }

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

      // If no audio is available, quit immediately.
      if (Howler.noAudio) {
        self._emit('loaderror', null, 'No audio support.');
        return;
      }

      // Make sure our source is in an array.
      if (typeof self._src === 'string') {
        self._src = [self._src];
      }

      // Loop through the sources and pick the first one that is compatible.
      for (var i=0; i<self._src.length; i++) {
        var ext, str;

        if (self._format && self._format[i]) {
          // If an extension was specified, use that instead.
          ext = self._format[i];
        } else {
          // Make sure the source is a string.
          str = self._src[i];
          if (typeof str !== 'string') {
            self._emit('loaderror', null, 'Non-string found in selected audio sources - ignoring.');
            continue;
          }

          // Extract the file extension from the URL or base64 data URI.
          ext = /^data:audio\/([^;,]+);/i.exec(str);
          if (!ext) {
            ext = /\.([^.]+)$/.exec(str.split('?', 1)[0]);
          }

          if (ext) {
            ext = ext[1].toLowerCase();
          }
        }

        // Log a warning if no extension was found.
        if (!ext) {
          console.warn('No file extension was found. Consider using the "format" property or specify an extension.');
        }

        // Check if this extension is available.
        if (ext && Howler.codecs(ext)) {
          url = self._src[i];
          break;
        }
      }

      if (!url) {
        self._emit('loaderror', null, 'No codec support for selected audio sources.');
        return;
      }

      self._src = url;
      self._state = 'loading';

      // If the hosting page is HTTPS and the source isn't,
      // drop down to HTML5 Audio to avoid Mixed Content errors.
      if (window.location.protocol === 'https:' && url.slice(0, 5) === 'http:') {
        self._html5 = true;
        self._webAudio = false;
      }

      // Create a new sound object and add it to the pool.
      new Sound(self);

      // Load and decode the audio data for playback.
      if (self._webAudio) {
        loadBuffer(self);
      }

      return self;
    }
function ( ) { var self = this ; var url = null ; // If no audio is available, quit immediately. if ( Howler . noAudio ) { self . _emit ( 'loaderror' , null , 'No audio support.' ) ; return ; } // Make sure our source is in an array. if ( typeof self . _src === 'string' ) { self . _src = [ self . _src ] ; } // Loop through the sources and pick the first one that is compatible. for ( var i = 0 ; i < self . _src . length ; i ++ ) { var ext , str ; if ( self . _format && self . _format [ i ] ) { // If an extension was specified, use that instead. ext = self . _format [ i ] ; } else { // Make sure the source is a string. str = self . _src [ i ] ; if ( typeof str !== 'string' ) { self . _emit ( 'loaderror' , null , 'Non-string found in selected audio sources - ignoring.' ) ; continue ; } // Extract the file extension from the URL or base64 data URI. ext = / ^data:audio\/([^;,]+); / i . exec ( str ) ; if ( ! ext ) { ext = / \.([^.]+)$ / . exec ( str . split ( '?' , 1 ) [ 0 ] ) ; } if ( ext ) { ext = ext [ 1 ] . toLowerCase ( ) ; } } // Log a warning if no extension was found. if ( ! ext ) { console . warn ( 'No file extension was found. Consider using the "format" property or specify an extension.' ) ; } // Check if this extension is available. if ( ext && Howler . codecs ( ext ) ) { url = self . _src [ i ] ; break ; } } if ( ! url ) { self . _emit ( 'loaderror' , null , 'No codec support for selected audio sources.' ) ; return ; } self . _src = url ; self . _state = 'loading' ; // If the hosting page is HTTPS and the source isn't, // drop down to HTML5 Audio to avoid Mixed Content errors. if ( window . location . protocol === 'https:' && url . slice ( 0 , 5 ) === 'http:' ) { self . _html5 = true ; self . _webAudio = false ; } // Create a new sound object and add it to the pool. new Sound ( self ) ; // Load and decode the audio data for playback. if ( self . _webAudio ) { loadBuffer ( self ) ; } return self ; }
Load the audio file.
@return {Howler}
Load the audio file .
Load the audio file.