コード例 #1
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)
コード例 #2
0
 def test_returns_array(self):
     freq = 800
     q = .15
     gain = 1
     augmentor = audaugio.EqualizerAugmentation(freq, q, gain)
     augmented = augmentor.augment(self.audio, self.sr)
     self.assertIsInstance(augmented, List)
コード例 #3
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)
コード例 #4
0
 def test_gain_down(self):
     freq = 400
     q = .2
     gain = -3
     augmentor = audaugio.EqualizerAugmentation(freq, q, gain)
     augmented = augmentor.augment(self.audio, self.sr)
     self.assertEqual(len(augmented), 1)
     self.assertEqual(len(augmented[0]), len(self.audio))
コード例 #5
0
 def test_gain_up(self):
     freq = 16000
     q = .1
     gain = 1
     augmentor = audaugio.EqualizerAugmentation(freq, q, gain)
     augmented = augmentor.augment(self.audio, self.sr)
     self.assertEqual(len(augmented), 1)
     self.assertEqual(len(augmented[0]), len(self.audio))
コード例 #6
0
ファイル: example.py プロジェクト: xdcesc/AudAugio
import librosa

import audaugio

y, sr = librosa.load('sample.wav')

chain = audaugio.CombinatoricChain(
    audaugio.PitchShiftAugmentation(1),
    audaugio.BackgroundNoiseAugmentation(.005),
    audaugio.EqualizerAugmentation(800, .15, -15))

augmented_audio = chain(y, sr)

for i, a in enumerate(augmented_audio):
    librosa.output.write_wav("output/{0}.wav".format(i), a, sr)