public class WhiteNoise extends java.lang.Object implements AudioSignal
| Modifier and Type | Field and Description |
|---|---|
protected float |
amp |
protected float |
leftScale |
protected float |
pan |
protected float |
rightScale |
| Constructor and Description |
|---|
WhiteNoise()
Constructs a white noise generator with an amplitude of 1.
|
WhiteNoise(float amp)
Constructs a white noise generator with the given amplitude.
|
| Modifier and Type | Method and Description |
|---|---|
void |
generate(float[] signal)
Fills
signal with values in the range of [-1, 1]. |
void |
generate(float[] left,
float[] right)
Fills
left and right with values in the range
of [-1, 1]. |
void |
setAmp(float a)
Sets the amplitude to
a. |
void |
setPan(float p)
Sets the pan to
|
protected float amp
protected float pan
protected float leftScale
protected float rightScale
public WhiteNoise()
public WhiteNoise(float amp)
amp
should be between 0 and 1.amp - the amplitudepublic void setAmp(float a)
a. This value will be constrained to [0, 1].a - the new amplitudepublic void setPan(float p)
p - the new panpublic void generate(float[] signal)
AudioSignalsignal with values in the range of [-1, 1].
signal represents a mono audio signal.generate in interface AudioSignalsignal - the float array to fillpublic void generate(float[] left,
float[] right)
AudioSignalleft and right with values in the range
of [-1, 1]. left represents the left channel of a stereo
signal, right represents the right channel of that same
stereo signal.generate in interface AudioSignalleft - the left channelright - the right channel