|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.badlogic.gdx.audio.analysis.AudioTools
public class AudioTools
Class holding various static native methods for processing audio data.
Constructor Summary | |
---|---|
AudioTools()
|
Method Summary | |
---|---|
static java.nio.FloatBuffer |
allocateFloatBuffer(int numSamples,
int numChannels)
Allcoates a direct buffer for the given number of samples and channels. |
static java.nio.ShortBuffer |
allocateShortBuffer(int numSamples,
int numChannels)
Allcoates a direct buffer for the given number of samples and channels. |
static void |
convertToFloat(java.nio.ShortBuffer source,
java.nio.FloatBuffer target,
int numSamples)
Converts the 16-bit signed PCM data given in source to 32-bit float PCM in the range [-1,1]. |
static void |
convertToMono(java.nio.FloatBuffer source,
java.nio.FloatBuffer target,
int numSamples)
Converts the samples in source which are assumed to be interleaved left/right stereo samples to mono, writting the converted samples to target. |
static void |
convertToMono(java.nio.ShortBuffer source,
java.nio.ShortBuffer target,
int numSamples)
Converts the samples in source which are assumed to be interleaved left/right stereo samples to mono, writting the converted samples to target. |
static void |
convertToShort(java.nio.FloatBuffer source,
java.nio.ShortBuffer target,
int numSamples)
Converts the 32-bit float PCM data given in source to 16-bit signed PCM in the range [-1,1]. |
static float |
spectralFlux(java.nio.FloatBuffer spectrumA,
java.nio.FloatBuffer spectrumB,
int numSamples)
Calculates the spectral flux between the two given spectra. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AudioTools()
Method Detail |
---|
public static void convertToFloat(java.nio.ShortBuffer source, java.nio.FloatBuffer target, int numSamples)
source
- the source buffertarget
- the target buffernumSamples
- the number of samplespublic static void convertToShort(java.nio.FloatBuffer source, java.nio.ShortBuffer target, int numSamples)
source
- the source buffertarget
- the target buffernumSamples
- the number of samplespublic static void convertToMono(java.nio.ShortBuffer source, java.nio.ShortBuffer target, int numSamples)
source
- the source buffertarget
- the target buffernumSamples
- the number of samples to convert (target will have numSamples /2 filled after a call to this)public static void convertToMono(java.nio.FloatBuffer source, java.nio.FloatBuffer target, int numSamples)
source
- the source buffertarget
- the target buffernumSamples
- the number of samples to convert (target will have numSamples /2 filled after a call to this)public static float spectralFlux(java.nio.FloatBuffer spectrumA, java.nio.FloatBuffer spectrumB, int numSamples)
spectrumA
- the first spectrumspectrumB
- the second spectrumnumSamples
- the number of elements
public static java.nio.FloatBuffer allocateFloatBuffer(int numSamples, int numChannels)
numSamples
- the number of samplesnumChannels
- the number of channels
public static java.nio.ShortBuffer allocateShortBuffer(int numSamples, int numChannels)
numSamples
- the number of samplesnumChannels
- the number of channels
|
libgdx API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |