def _calc_energy(self, sound_chunk): """Calculates how loud the sound is""" return audioop.rms(sound_chunk, self.sample_width)