Package processing.sound
Class Waveform
java.lang.Object
processing.sound.Analyzer
processing.sound.Waveform
This is a Waveform analyzer. It returns the waveform of an
audio stream the moment it is queried with the analyze()
method.
Note that by default all sound generators (including microphone capture from
Note that by default all sound generators (including microphone capture from
AudioIn
) have an amplitude of 1, which means that the values of
their waveform will be numbers in the range [-0.5, 0.5]
.- Author:
- icalvin102
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat[]
analyze()
Gets the content of the current audiobuffer from the input source, writes it into this Waveform's `data` array, and returns it.float[]
analyze
(float[] value) Gets the content of the current audiobuffer from the input source.void
input
(SoundObject input) Define the audio input for the analyzer.
-
Field Details
-
data
public float[] data
-
-
Constructor Details
-
Waveform
- Parameters:
parent
- typically use "this"nsamples
- number of waveform samples that you want to be able to read at once (a positive integer).
-
-
Method Details
-
analyze
public float[] analyze()Gets the content of the current audiobuffer from the input source, writes it into this Waveform's `data` array, and returns it.- Returns:
- the current audiobuffer of the input source. The array has as many elements as this Waveform analyzer's number of samples
-
analyze
public float[] analyze(float[] value) Gets the content of the current audiobuffer from the input source.- Parameters:
value
- an array with as many elements as this Waveform analyzer's number of samples- Returns:
- the current audiobuffer of the input source. The array has as many elements as this Waveform analyzer's number of samples
-
input
Define the audio input for the analyzer.
-