public class AudioEvent
extends java.lang.Object
Constructor and Description |
---|
AudioEvent(javax.sound.sampled.AudioFormat format,
long frameLength) |
Modifier and Type | Method and Description |
---|---|
static double |
calculateRMS(float[] floatBuffer)
Calculates and returns the root mean square of the signal.
|
void |
clearFloatBuffer() |
int |
getBufferSize() |
byte[] |
getByteBuffer()
Return a byte array with the audio data in bytes.
|
float[] |
getFloatBuffer() |
int |
getOverlap() |
double |
getProgress()
Calculate the progress in percentage of the total number of frames.
|
double |
getRMS()
Calculates and returns the root mean square of the signal.
|
float |
getSampleRate() |
long |
getSamplesProcessed() |
double |
getTimeStamp()
Calculates and returns the time stamp at the beginning of this audio event.
|
boolean |
isSilence(double silenceThreshold) |
void |
setBytesProcessed(long bytesProcessed) |
void |
setFloatBuffer(float[] floatBuffer) |
void |
setOverlap(int newOverlap) |
public AudioEvent(javax.sound.sampled.AudioFormat format, long frameLength)
public float getSampleRate()
public int getBufferSize()
public int getOverlap()
public void setOverlap(int newOverlap)
public void setBytesProcessed(long bytesProcessed)
public double getTimeStamp()
public long getSamplesProcessed()
public double getProgress()
public byte[] getByteBuffer()
public void setFloatBuffer(float[] floatBuffer)
public float[] getFloatBuffer()
public double getRMS()
public static double calculateRMS(float[] floatBuffer)
floatBuffer
- The audio buffer to calculate the RMS for.public void clearFloatBuffer()
public boolean isSilence(double silenceThreshold)