    def random_select(self, wav, duration, wav_path):
        """
        wav: (T,)
        """
        if duration <= self.max_duration:
            return wav

        ts_frame = int((duration - self.max_duration) * self.highest_sample_rate)
        start = random.randint(0, ts_frame)
        end = start + self.max_n_frames

        if (wav[start:end] == 0).all():
            print("*" * 20)
            print("Warning! The wav file {} has a lot of silience.".format(wav_path))

            # There should be at least some frames that are not silience. Then we select them.
            assert (wav != 0).any()
            start = np.where(wav != 0)[0][0]
            end = start + self.max_n_frames

        return wav[start:end]
wav: (T,)
models/svc/base/svc_dataset.py