Returns the generation rate for this stimulus

        :returns: int -- the output samplerate (Hz)

def samplerate(self):
        """Returns the generation rate for this stimulus

        :returns: int -- the output samplerate (Hz)
        """
        rates = []
        for track in self._segments:
            for component in track:
                # special case, where component is a wav file:
                # it will set the master samplerate to match its own
                if component.__class__.__name__ == 'Vocalization':
                    if component.samplerate() is not None:
                        rates.append(component.samplerate())

        if len(set(rates)) > 1:
            # error check
            # raise Exception("Wav files with different sample rates in same stimulus")
            logger = logging.getLogger('main')
            logger.error("Wav files with different sample rates in same stimulus")
            return None
        elif len(set(rates)) == 1:
            return rates[0]
        else:
            return DEFAULT_SAMPLERATE