def test_substitute(self):
    data = AudioLoader.load_mel_spectrogram(self.sample_wav_file, n_mels=128)
    aug = nas.LoudnessAug(stateless=False)
    aug_data = aug.augment(data)
    comparison = (data[:, aug.time_start:aug.time_end] == aug_data[:, aug.time_start:aug.time_end])
    self.assertFalse(comparison.all())
    comparison = (data[:, :aug.time_start] == aug_data[:, :aug.time_start])
    self.assertTrue(comparison.all())
    comparison = (data[:, aug.time_end:] == aug_data[:, aug.time_end:])
    self.assertTrue(comparison.all())
def test_substitute(self):
    data = AudioLoader.load_mel_spectrogram(self.sample_wav_file, n_mels=128)
    aug = nas.LoudnessAug(stateless=False)
    aug_data = aug.augment(data)
    comparison = (data[:, aug.time_start:aug.time_end] == aug_data[:, aug.time_start:aug.time_end])
    self.assertFalse(comparison.all())
    comparison = (data[:, :aug.time_start] == aug_data[:, :aug.time_start])
    self.assertTrue(comparison.all())
    comparison = (data[:, aug.time_end:] == aug_data[:, aug.time_end:])
    self.assertTrue(comparison.all())