src/components/sound.js
function (processSound) {
    var found;
    var i;
    var sound;

    if (!this.loaded) {
      warn('Sound not loaded yet. It will be played once it finished loading');
      this.mustPlay = true;
      return;
    }

    found = false;
    this.isPlaying = true;
    for (i = 0; i < this.pool.children.length; i++) {
      sound = this.pool.children[i];
      if (!sound.isPlaying && sound.buffer && !found) {
        if (processSound) { processSound(sound); }
        sound.play();
        sound.isPaused = false;
        found = true;
        continue;
      }
    }

    if (!found) {
      warn('All the sounds are playing. If you need to play more sounds simultaneously ' +
           'consider increasing the size of pool with the `poolSize` attribute.', this.el);
      return;
    }

    this.mustPlay = false;
  }
function (processSound) {
    var found;
    var i;
    var sound;

    if (!this.loaded) {
      warn('Sound not loaded yet. It will be played once it finished loading');
      this.mustPlay = true;
      return;
    }

    found = false;
    this.isPlaying = true;
    for (i = 0; i < this.pool.children.length; i++) {
      sound = this.pool.children[i];
      if (!sound.isPlaying && sound.buffer && !found) {
        if (processSound) { processSound(sound); }
        sound.play();
        sound.isPaused = false;
        found = true;
        continue;
      }
    }

    if (!found) {
      warn('All the sounds are playing. If you need to play more sounds simultaneously ' +
           'consider increasing the size of pool with the `poolSize` attribute.', this.el);
      return;
    }

    this.mustPlay = false;
  }
function ( processSound ) { var found ; var i ; var sound ; if ( ! this . loaded ) { warn ( 'Sound not loaded yet. It will be played once it finished loading' ) ; this . mustPlay = true ; return ; } found = false ; this . isPlaying = true ; for ( i = 0 ; i < this . pool . children . length ; i ++ ) { sound = this . pool . children [ i ] ; if ( ! sound . isPlaying && sound . buffer && ! found ) { if ( processSound ) { processSound ( sound ) ; } sound . play ( ) ; sound . isPaused = false ; found = true ; continue ; } } if ( ! found ) { warn ( 'All the sounds are playing. If you need to play more sounds simultaneously ' + 'consider increasing the size of pool with the `poolSize` attribute.' , this . el ) ; return ; } this . mustPlay = false ; }
Look for an unused sound in the pool and play it if found.
Look for an unused sound in the pool and play it if found .