|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.beadsproject.beads.core.AudioUtils
public final class AudioUtils
AudioUtils provides basic conversion of buffers of audio data between different formats, interleaving, and some other miscellaneous audio functions.
Field Summary | |
---|---|
static java.util.Random |
rng
A handy random number generator. |
Constructor Summary | |
---|---|
AudioUtils()
|
Method Summary | |
---|---|
static void |
byteToFloat(float[] out,
byte[] in,
boolean bigEndian)
Converts a buffer of bytes to a buffer of floats with a given byte order. |
static void |
deinterleave(float[] source,
int nChannels,
int nFrames,
float[][] result)
De-interleave an interleaved buffer of floats to form a 2D array of floats of size nChannels x nFrames. |
static double |
fastPow(double a,
double b)
Does a freaky shortcut for calculating pow, faster but less accurate than regular Math.pow(). |
static void |
floatToByte(byte[] out,
float[] in,
boolean bigEndian)
Converts a buffer of floats to a buffer of bytes with a given byte order. |
static void |
floatToShort(short[] out,
float[] in)
Converts a buffer of floats to a buffer of shorts. |
static void |
interleave(float[][] source,
int nChannels,
int nFrames,
float[] result)
Interleave a 2D array of floats of size nChannels x nFrames to form a single interleaved buffer of floats. |
static void |
shortToFloat(float[] out,
short[] in)
Converts a buffer of shorts to a buffer of floats. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Random rng
Constructor Detail |
---|
public AudioUtils()
Method Detail |
---|
public static final void shortToFloat(float[] out, short[] in)
out
- buffer of floats.in
- buffer of shorts.public static final void floatToShort(short[] out, float[] in)
out
- buffer of shorts.in
- buffer of floats.public static final void floatToByte(byte[] out, float[] in, boolean bigEndian)
out
- buffer of bytes.in
- buffer of floats.bigEndian
- true for big endian byte order, false otherwise.public static final void byteToFloat(float[] out, byte[] in, boolean bigEndian)
out
- buffer of floats.in
- buffer of bytes.bigEndian
- true for big endian byte order, false otherwise.public static final void deinterleave(float[] source, int nChannels, int nFrames, float[][] result)
source
- interleaved buffer of floats.nChannels
- first dimension of resulting 2D array.nFrames
- second dimension of resulting 2D array.result
- the resultpublic static final void interleave(float[][] source, int nChannels, int nFrames, float[] result)
source
- 2D array of floats.nChannels
- first dimension of input 2D array.nFrames
- second dimension of input 2D array.result
- the resultpublic static double fastPow(double a, double b)
a
- the base.b
- the exponent.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |