function() {
      var self = this;
      var args = arguments;
      var seek, id;

      // Determine the values based on arguments.
      if (args.length === 0) {
        // We will simply return the current position of the first node.
        id = self._sounds[0]._id;
      } else if (args.length === 1) {
        // First check if this is an ID, and if not, assume it is a new seek position.
        var ids = self._getSoundIds();
        var index = ids.indexOf(args[0]);
        if (index >= 0) {
          id = parseInt(args[0], 10);
        } else if (self._sounds.length) {
          id = self._sounds[0]._id;
          seek = parseFloat(args[0]);
        }
      } else if (args.length === 2) {
        seek = parseFloat(args[0]);
        id = parseInt(args[1], 10);
      }

      // If there is no ID, bail out.
      if (typeof id === 'undefined') {
        return self;
      }

      // If the sound hasn't loaded, add it to the load queue to seek when capable.
      if (self._state !== 'loaded' || self._playLock) {
        self._queue.push({
          event: 'seek',
          action: function() {
            self.seek.apply(self, args);
          }
        });

        return self;
      }

      // Get the sound.
      var sound = self._soundById(id);

      if (sound) {
        if (typeof seek === 'number' && seek >= 0) {
          // Pause the sound and update position for restarting playback.
          var playing = self.playing(id);
          if (playing) {
            self.pause(id, true);
          }

          // Move the position of the track and cancel timer.
          sound._seek = seek;
          sound._ended = false;
          self._clearTimer(id);

          // Update the seek position for HTML5 Audio.
          if (!self._webAudio && sound._node && !isNaN(sound._node.duration)) {
            sound._node.currentTime = seek;
          }

          // Seek and emit when ready.
          var seekAndEmit = function() {
            self._emit('seek', id);

            // Restart the playback if the sound was playing.
            if (playing) {
              self.play(id, true);
            }
          };

          // Wait for the play lock to be unset before emitting (HTML5 Audio).
          if (playing && !self._webAudio) {
            var emitSeek = function() {
              if (!self._playLock) {
                seekAndEmit();
              } else {
                setTimeout(emitSeek, 0);
              }
            };
            setTimeout(emitSeek, 0);
          } else {
            seekAndEmit();
          }
        } else {
          if (self._webAudio) {
            var realTime = self.playing(id) ? Howler.ctx.currentTime - sound._playStart : 0;
            var rateSeek = sound._rateSeek ? sound._rateSeek - sound._seek : 0;
            return sound._seek + (rateSeek + realTime * Math.abs(sound._rate));
          } else {
            return sound._node.currentTime;
          }
        }
      }

      return self;
    }
function() {
      var self = this;
      var args = arguments;
      var seek, id;

      // Determine the values based on arguments.
      if (args.length === 0) {
        // We will simply return the current position of the first node.
        id = self._sounds[0]._id;
      } else if (args.length === 1) {
        // First check if this is an ID, and if not, assume it is a new seek position.
        var ids = self._getSoundIds();
        var index = ids.indexOf(args[0]);
        if (index >= 0) {
          id = parseInt(args[0], 10);
        } else if (self._sounds.length) {
          id = self._sounds[0]._id;
          seek = parseFloat(args[0]);
        }
      } else if (args.length === 2) {
        seek = parseFloat(args[0]);
        id = parseInt(args[1], 10);
      }

      // If there is no ID, bail out.
      if (typeof id === 'undefined') {
        return self;
      }

      // If the sound hasn't loaded, add it to the load queue to seek when capable.
      if (self._state !== 'loaded' || self._playLock) {
        self._queue.push({
          event: 'seek',
          action: function() {
            self.seek.apply(self, args);
          }
        });

        return self;
      }

      // Get the sound.
      var sound = self._soundById(id);

      if (sound) {
        if (typeof seek === 'number' && seek >= 0) {
          // Pause the sound and update position for restarting playback.
          var playing = self.playing(id);
          if (playing) {
            self.pause(id, true);
          }

          // Move the position of the track and cancel timer.
          sound._seek = seek;
          sound._ended = false;
          self._clearTimer(id);

          // Update the seek position for HTML5 Audio.
          if (!self._webAudio && sound._node && !isNaN(sound._node.duration)) {
            sound._node.currentTime = seek;
          }

          // Seek and emit when ready.
          var seekAndEmit = function() {
            self._emit('seek', id);

            // Restart the playback if the sound was playing.
            if (playing) {
              self.play(id, true);
            }
          };

          // Wait for the play lock to be unset before emitting (HTML5 Audio).
          if (playing && !self._webAudio) {
            var emitSeek = function() {
              if (!self._playLock) {
                seekAndEmit();
              } else {
                setTimeout(emitSeek, 0);
              }
            };
            setTimeout(emitSeek, 0);
          } else {
            seekAndEmit();
          }
        } else {
          if (self._webAudio) {
            var realTime = self.playing(id) ? Howler.ctx.currentTime - sound._playStart : 0;
            var rateSeek = sound._rateSeek ? sound._rateSeek - sound._seek : 0;
            return sound._seek + (rateSeek + realTime * Math.abs(sound._rate));
          } else {
            return sound._node.currentTime;
          }
        }
      }

      return self;
    }
function ( ) { var self = this ; var args = arguments ; var seek , id ; // Determine the values based on arguments. if ( args . length === 0 ) { // We will simply return the current position of the first node. id = self . _sounds [ 0 ] . _id ; } else if ( args . length === 1 ) { // First check if this is an ID, and if not, assume it is a new seek position. var ids = self . _getSoundIds ( ) ; var index = ids . indexOf ( args [ 0 ] ) ; if ( index >= 0 ) { id = parseInt ( args [ 0 ] , 10 ) ; } else if ( self . _sounds . length ) { id = self . _sounds [ 0 ] . _id ; seek = parseFloat ( args [ 0 ] ) ; } } else if ( args . length === 2 ) { seek = parseFloat ( args [ 0 ] ) ; id = parseInt ( args [ 1 ] , 10 ) ; } // If there is no ID, bail out. if ( typeof id === 'undefined' ) { return self ; } // If the sound hasn't loaded, add it to the load queue to seek when capable. if ( self . _state !== 'loaded' || self . _playLock ) { self . _queue . push ( { event : 'seek' , action : function ( ) { self . seek . apply ( self , args ) ; } } ) ; return self ; } // Get the sound. var sound = self . _soundById ( id ) ; if ( sound ) { if ( typeof seek === 'number' && seek >= 0 ) { // Pause the sound and update position for restarting playback. var playing = self . playing ( id ) ; if ( playing ) { self . pause ( id , true ) ; } // Move the position of the track and cancel timer. sound . _seek = seek ; sound . _ended = false ; self . _clearTimer ( id ) ; // Update the seek position for HTML5 Audio. if ( ! self . _webAudio && sound . _node && ! isNaN ( sound . _node . duration ) ) { sound . _node . currentTime = seek ; } // Seek and emit when ready. var seekAndEmit = function ( ) { self . _emit ( 'seek' , id ) ; // Restart the playback if the sound was playing. if ( playing ) { self . play ( id , true ) ; } } ; // Wait for the play lock to be unset before emitting (HTML5 Audio). if ( playing && ! self . _webAudio ) { var emitSeek = function ( ) { if ( ! self . _playLock ) { seekAndEmit ( ) ; } else { setTimeout ( emitSeek , 0 ) ; } } ; setTimeout ( emitSeek , 0 ) ; } else { seekAndEmit ( ) ; } } else { if ( self . _webAudio ) { var realTime = self . playing ( id ) ? Howler . ctx . currentTime - sound . _playStart : 0 ; var rateSeek = sound . _rateSeek ? sound . _rateSeek - sound . _seek : 0 ; return sound . _seek + ( rateSeek + realTime * Math . abs ( sound . _rate ) ) ; } else { return sound . _node . currentTime ; } } } return self ; }
Get/set the seek position of a sound. This method can optionally take 0, 1 or 2 arguments.
seek() -> Returns the first sound node's current seek position.
seek(id) -> Returns the sound id's current seek position.
seek(seek) -> Sets the seek position of the first sound node.
seek(seek, id) -> Sets the seek position of passed sound id.
@return {Howl/Number} Returns self or the current seek position.
Get / set the seek position of a sound . This method can optionally take 0 1 or 2 arguments . seek () - > Returns the first sound node s current seek position . seek ( id ) - > Returns the sound id s current seek position . seek ( seek ) - > Sets the seek position of the first sound node . seek ( seek id ) - > Sets the seek position of passed sound id .
Seek to the specified position.