code: def extract_specific_interval(self, interval_start, interval_end):
          
  
          interval_start = int(interval_start)
          interval_end = int(interval_end)
  
          if interval_start >= interval_end:
              raise ValueError("Requested interval's start point is past the requested end point.")
  
          elif interval_start > self.time_series.size:
              if self.repeat:
                  interval_end = interval_end - interval_start
                  interval_start = 0
              else:
                  raise ValueError("Requested interval's start point is past the end of the time series.")
  
          if interval_end < self.time_series.size:
              interval = self.time_series[interval_start:interval_end]
  
          else:
              requested_interval_size = interval_end - interval_start
              remaining_signal = self.time_series[interval_start:self.time_series.size]
  
              if self.next_file == len(self.sound_files) and self.repeat:
                  self.next_file = 0
  
              if self.next_file < len(self.sound_files):
                  next_source = audiolab.Sndfile(self.sound_files[self.next_file], 'r')
                  self.next_file += 1
  
                  if next_source.samplerate != self.sample_rate:
                      raise ValueError("All sound files must be of the same sample rate")
  
                  if self.gap_between_sounds > 0:
                      remaining_signal = hstack((remaining_signal, zeros(int(self.gap_between_sounds*self.sample_rate), dtype=self.precision)))
  
                  self.time_series = hstack((remaining_signal, next_source.read_frames(next_source.nframes, dtype=self.precision)))
  
                  interval = self.time_series[0:requested_interval_size]
                  self._next_interval_start = requested_interval_size
  
              else:
                  self.warning("Returning last interval of the time series.")
                  self._next_interval_start = self.time_series.size + 1
  
                  samples_per_interval = self.interval_length*self.sample_rate
                  interval = hstack((remaining_signal, zeros(samples_per_interval-remaining_signal.size)))
  
          return interval
docs: Overload if special behaviour is required when a series ends.