public class Audio extends Object
| Constructor and Description |
|---|
Audio() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
getAudio16(AudioFrame frame)
Get byte array with interleaved signed two byte samples.
|
static byte[] |
getAudio24(AudioFrame frame)
Get byte array with interleaved signed three byte samples.
|
static byte[] |
getAudio32(AudioFrame frame)
Get byte array with interleaved signed four byte samples.
|
static byte[] |
getAudio8(AudioFrame frame)
Get byte array with interleaved signed
byte samples. |
static int |
getFormatDepth(SampleFormat format)
Get number of bytes per sample for specified sample format.
|
static Number |
getValue(ByteBuffer buffer,
SampleFormat format,
int index)
Read a
Number at specified index from ByteBuffer for specified
SampleFormat. |
public static int getFormatDepth(SampleFormat format)
format - the sample format.zero if sample format is unknown.public static Number getValue(ByteBuffer buffer, SampleFormat format, int index)
Number at specified index from ByteBuffer for specified
SampleFormat. Depending on the sample format the value is represented by
a byte, short, integer, float or double number.buffer - ByteBuffer with audio samples.format - SampleFormat of audio samples in the buffer.index - the position in the buffer.Number, or zero
if sample format is unknown.public static byte[] getAudio8(AudioFrame frame)
byte samples. Since each sample fits in
one byte the possible sample values are within the interval [-2^7, 2^7-1]. It is assumed
that the samples within the AudioFrame are normalized, meaning in [-1, 1].frame - AudioFrame with audio samples.public static byte[] getAudio16(AudioFrame frame)
AudioFrame are normalized, meaning in [-1, 1].frame - AudioFrame with audio samples.public static byte[] getAudio24(AudioFrame frame)
AudioFrame are normalized, meaning in [-1, 1].frame - AudioFrame with audio samples.public static byte[] getAudio32(AudioFrame frame)
AudioFrame are normalized, meaning in [-1, 1].frame - AudioFrame with audio samples.Copyright © 2013. All Rights Reserved.