Beispiel #1
0
 def test_large_chain(self):
     chain = audaugio.FlatChain(audaugio.PitchShiftAugmentation(-1),
                                audaugio.TimeStretchAugmentation(.95),
                                audaugio.EqualizerAugmentation(300, 1, 2),
                                audaugio.BackgroundNoiseAugmentation(.005),
                                audaugio.TimeStretchAugmentation(1.25))
     augmented = chain(self.signal, self.sr)
     self.assertEqual(len(augmented), 5)
Beispiel #2
0
 def test_small_chain(self):
     chain = audaugio.CombinatoricChain(
         audaugio.PitchShiftAugmentation(1),
         audaugio.TimeStretchAugmentation(.95),
         audaugio.EqualizerAugmentation(400, 1, 2))
     augmented = chain(self.signal, self.sr)
     self.assertEqual(len(augmented), 2**3)
Beispiel #3
0
 def test_slow_down(self):
     augmentor = audaugio.TimeStretchAugmentation(1 -
                                                  .1 * np.random.random())
     augmented = augmentor.augment(self.audio, self.sr)
     self.assertGreater(len(augmented[0]), len(self.audio))
Beispiel #4
0
 def test_returns_array(self):
     augmentor = audaugio.TimeStretchAugmentation(1.05)
     augmented = augmentor.augment(self.audio, self.sr)
     self.assertIsInstance(augmented, List)
Beispiel #5
0
 def test_speed_up(self):
     augmentor = audaugio.TimeStretchAugmentation(1 +
                                                  .1 * np.random.random())
     augmented = augmentor.augment(self.audio, self.sr)
     self.assertLess(len(augmented[0]), len(self.audio))