WavUtil
@UnstableApi
public final class WavUtil
Utilities for handling WAVE files.
Summary
Constants |
|
|---|---|
static final int |
DATA_FOURCC = 1684108385Four character code for "data". |
static final int |
DS64_FOURCC = 1685272116Four character code for "ds64". |
static final int |
FMT_FOURCC = 1718449184Four character code for "fmt ". |
static final int |
RF64_FOURCC = 1380333108Four character code for "RF64". |
static final int |
RIFF_FOURCC = 1380533830Four character code for "RIFF". |
static final int |
TYPE_ALAW = 6WAVE type value for 8-bit ITU-T G.711 A-law audio data. |
static final int |
TYPE_FLOAT = 3WAVE type value for float PCM audio data. |
static final int |
TYPE_IMA_ADPCM = 17WAVE type value for IMA ADPCM audio data. |
static final int |
TYPE_MLAW = 7WAVE type value for 8-bit ITU-T G.711 mu-law audio data. |
static final int |
TYPE_PCM = 1WAVE type value for integer PCM audio data. |
static final int |
TYPE_WAVE_FORMAT_EXTENSIBLE = 65534WAVE type value for extended WAVE format. |
static final int |
WAVE_FOURCC = 1463899717Four character code for "WAVE". |
Public methods |
|
|---|---|
static int |
@C.PcmEncodingReturns the |
static int |
getTypeForPcmEncoding(@C.PcmEncoding int pcmEncoding)Returns the WAVE format type value for the given |
Constants
TYPE_ALAW
public static final int TYPE_ALAW = 6
WAVE type value for 8-bit ITU-T G.711 A-law audio data.
TYPE_IMA_ADPCM
public static final int TYPE_IMA_ADPCM = 17
WAVE type value for IMA ADPCM audio data.
TYPE_MLAW
public static final int TYPE_MLAW = 7
WAVE type value for 8-bit ITU-T G.711 mu-law audio data.
TYPE_WAVE_FORMAT_EXTENSIBLE
public static final int TYPE_WAVE_FORMAT_EXTENSIBLE = 65534
WAVE type value for extended WAVE format.
Public methods
getPcmEncodingForType
@C.PcmEncoding
public static int getPcmEncodingForType(int type, int bitsPerSample)
Returns the C.PcmEncoding for the given WAVE format type value, or ENCODING_INVALID if the type is not a known PCM type.
getTypeForPcmEncoding
public static int getTypeForPcmEncoding(@C.PcmEncoding int pcmEncoding)
Returns the WAVE format type value for the given C.PcmEncoding.
| Parameters | |
|---|---|
@C.PcmEncoding int pcmEncoding |
The |
| Returns | |
|---|---|
int |
The corresponding WAVE format type. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |