|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object be.hogent.tarsos.dsp.AudioEvent
public class AudioEvent
An audio event flows through the processing pipeline. The object is reused for performance reasons. The arrays with audio information are also reused, so watch out when using the buffer getter and setters.
Constructor Summary | |
---|---|
AudioEvent(javax.sound.sampled.AudioFormat format,
long frameLength)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioEvent(javax.sound.sampled.AudioFormat format, long frameLength)
Method Detail |
---|
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |