public class RandomNoiseProducer extends Object implements NoiseProducer
Sample from one of the given noiseFiles.
By default this noise comes from one of three files, all located in
/sounds/noises/: radio_tuning.wav,
restaurant.wav, and swimming.wav. This can be
overridden by passing the location of your own sound files to the
constructor, e.g.:
String myFiles = { "/mysounds/noise1.wav", "/mysounds/noise2.wav" };
NoiseProducer myNp = new RandomNoiseProducer(myFiles);
| Constructor and Description |
|---|
RandomNoiseProducer()
Creates a
RandomNoiseProducer from default set of noises. |
RandomNoiseProducer(String[] noiseFiles)
Creates a
RandomNoiseProducer from one of the given noiseFiles. |
| Modifier and Type | Method and Description |
|---|---|
Sample |
addNoise(List<Sample> samples)
Append the given
samples to each other, then add random
noise to the result. |
public RandomNoiseProducer()
RandomNoiseProducer from default set of noises.public RandomNoiseProducer(String[] noiseFiles)
RandomNoiseProducer from one of the given noiseFiles.noiseFiles - array of paths to files.public Sample addNoise(List<Sample> samples)
NoiseProducersamples to each other, then add random
noise to the result.addNoise in interface NoiseProducersamples - list of Sample.Sample.Copyright © 2015. All rights reserved.