Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for i in range(5):
output_file_path = os.path.join(
output_dir, "FrequencyMask_{:03d}.wav".format(i)
)
augmented_samples = augmenter(samples=samples, sample_rate=SAMPLE_RATE)
wavfile.write(output_file_path, rate=SAMPLE_RATE, data=augmented_samples)
# TimeMask
augmenter = Compose([TimeMask(p=1.0)])
for i in range(5):
output_file_path = os.path.join(output_dir, "TimeMask_{:03d}.wav".format(i))
augmented_samples = augmenter(samples=samples, sample_rate=SAMPLE_RATE)
wavfile.write(output_file_path, rate=SAMPLE_RATE, data=augmented_samples)
# AddGaussianSNR
augmenter = Compose([AddGaussianSNR(p=1.0)])
for i in range(5):
output_file_path = os.path.join(
output_dir, "AddGaussianSNR_{:03d}.wav".format(i)
)
augmented_samples = augmenter(samples=samples, sample_rate=SAMPLE_RATE)
wavfile.write(output_file_path, rate=SAMPLE_RATE, data=augmented_samples)
# AddGaussianNoise
augmenter = Compose(
[AddGaussianNoise(min_amplitude=0.001, max_amplitude=0.015, p=1.0)]
)
for i in range(5):
output_file_path = os.path.join(
output_dir, "AddGaussianNoise_{:03d}.wav".format(i)
)
augmented_samples = augmenter(samples=samples, sample_rate=SAMPLE_RATE)