nl.captcha.audio.noise
Class RandomNoiseProducer

java.lang.Object
  extended by nl.captcha.audio.noise.RandomNoiseProducer
All Implemented Interfaces:
NoiseProducer

public class RandomNoiseProducer
extends java.lang.Object
implements NoiseProducer

Adds noise to a 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);
 

Author:
James Childers

Constructor Summary
RandomNoiseProducer()
           
RandomNoiseProducer(java.lang.String[] noiseFiles)
           
 
Method Summary
 Sample addNoise(java.util.List<Sample> samples)
          Append the given samples to each other, then add random noise to the result.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RandomNoiseProducer

public RandomNoiseProducer()

RandomNoiseProducer

public RandomNoiseProducer(java.lang.String[] noiseFiles)
Method Detail

addNoise

public Sample addNoise(java.util.List<Sample> samples)
Append the given samples to each other, then add random noise to the result.

Specified by:
addNoise in interface NoiseProducer

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010-2011 James Childers. All Rights Reserved.