
public class AudioFormat extends RefCounted
| Modifier and Type | Class and Description |
|---|---|
static class |
AudioFormat.Type
The format we use to represent audio.
|
| Modifier and Type | Method and Description |
|---|---|
AudioFormat |
copyReference()
Create a new AudioFormat object that is actually referring to the
exact same underlying native object.
|
boolean |
equals(Object obj)
Compares two values, returning true if the underlying objects in native code are the same object.
|
static AudioFormat.Type |
getAlternateSampleFormat(AudioFormat.Type sample_fmt,
boolean planar)
Return the planar<->packed alternative form of the given sample format, or
SAMPLE_FMT_NONE on error. |
static int |
getBufferSizeNeeded(int numSamples,
int numChannels,
AudioFormat.Type format)
Get the size of a buffer in bytes that would be required to hold the
number of samples of audio in the given format and with the given number of channels. |
static int |
getBytesPerSample(AudioFormat.Type sample_fmt)
Return number of bytes per sample.
|
static int |
getDataPlaneSizeNeeded(int numSamples,
int numChannels,
AudioFormat.Type format)
Get the size of a plane of audio bytes that would be required to hold the
number of samples of audio in the given format and with the given number of channels. |
static AudioFormat.Type |
getFormat(String name)
Return a sample format corresponding to name, or SAMPLE_FMT_NONE
on error. |
static String |
getName(AudioFormat.Type format)
Return the name of format, or NULL if format is not
recognized. |
static AudioFormat.Type |
getPackedSampleFormat(AudioFormat.Type sample_fmt)
Get the packed alternative form of the given sample format.
If the passed sample_fmt is already in packed format, the format returned is the same as the input. |
static AudioFormat.Type |
getPlanarSampleFormat(AudioFormat.Type sample_fmt)
Get the planar alternative form of the given sample format.
If the passed sample_fmt is already in planar format, the format returned is the same as the input. |
int |
hashCode()
Get a hashable value for this object.
|
static boolean |
isPlanar(AudioFormat.Type sample_fmt)
Check if the sample format is planar.
|
delete, getCurrentRefCountpublic AudioFormat copyReference()
copyReference in class RefCountedpublic boolean equals(Object obj)
public int hashCode()
public static String getName(AudioFormat.Type format)
public static AudioFormat.Type getFormat(String name)
public static AudioFormat.Type getAlternateSampleFormat(AudioFormat.Type sample_fmt, boolean planar)
public static AudioFormat.Type getPackedSampleFormat(AudioFormat.Type sample_fmt)
public static AudioFormat.Type getPlanarSampleFormat(AudioFormat.Type sample_fmt)
public static int getBytesPerSample(AudioFormat.Type sample_fmt)
sample_fmt - the sample formatpublic static boolean isPlanar(AudioFormat.Type sample_fmt)
sample_fmt - the sample format to inspectpublic static int getBufferSizeNeeded(int numSamples,
int numChannels,
AudioFormat.Type format)
public static int getDataPlaneSizeNeeded(int numSamples,
int numChannels,
AudioFormat.Type format)
If format is packed, then this method returns the same number as #getBufferSizeNeeded(int, int, Type).
Copyright © 2018 Humble Software. All rights reserved.