public interface AudioBuffer
AudioFormat
instance. The data might be in the form of complex numbers and/or magnitudes.
Note that even though you could, you must never change any of the float arrays contained in this buffer.
If you need to change one, copy/clone it first. This contract is not enforced programmatically, but relies on
the user adhering to it.SignalPullProcessor
,
SignalProcessor
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates an exact copy of this buffer.
|
AudioBuffer |
derive(float[] real,
float[] imaginary)
Creates a copy of this buffer, but replaces its values with the given real and imaginary data.
|
AudioFormat |
getAudioFormat()
Describes the audio data contained in this buffer.
|
float[] |
getData()
Returns a real representation of the data held by this buffer.
|
int |
getFrameNumber()
Number of the first frame at the beginning of this buffer.
|
float[] |
getImaginaryData()
Imaginary part of the data contained in this buffer.
|
float[] |
getMagnitudes()
Magnitudes (square root of the powers).
|
int |
getNumberOfSamples()
Returns the number of samples this buffer was built from.
|
float[] |
getPowers()
Powers (sum of the squares of the real and imaginary part).
|
float[] |
getRealData()
Real part of the data contained in this buffer.
|
long |
getTimestamp()
Time from the beginning of the track to the beginning of this buffer in ms.
|
long |
getTimestamp(TimeUnit timeUnit)
Time from the beginning of the track to the beginning of this buffer in the requested unit.
|
long getTimestamp()
getTimestamp(java.util.concurrent.TimeUnit)
with a
finer unit.
If we didn't start reading at the beginning of the file (i.e. timestamp == 0),
the offset may not be 100% precise.getFrameNumber()
,
getTimestamp(java.util.concurrent.TimeUnit)
long getTimestamp(TimeUnit timeUnit)
timeUnit
- time unitgetTimestamp()
int getFrameNumber()
getTimestamp()
, this method may not be the most accurate, if you didn't
start reading at the beginning of the file.getTimestamp()
,
AudioFormat
AudioFormat getAudioFormat()
float[] getData()
getAudioFormat()
.
This array is meant for reading only. Do not manipulate it!AbstractAudioSpectrum.getData()
float[] getRealData()
getData()
This array is meant for reading only. Do not manipulate it!float[] getImaginaryData()
float[] getPowers()
getMagnitudes()
float[] getMagnitudes()
getPowers()
int getNumberOfSamples()
AudioBuffer derive(float[] real, float[] imaginary)
real
- real dataimaginary
- imaginary dataObject clone() throws CloneNotSupportedException
CloneNotSupportedException
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.