@UnstableApi
public final class WavUtil


Utilities for handling WAVE files.

Summary

Constants

static final int
DATA_FOURCC = 1684108385

Four character code for "data".

static final int
DS64_FOURCC = 1685272116

Four character code for "ds64".

static final int
FMT_FOURCC = 1718449184

Four character code for "fmt ".

static final int
RF64_FOURCC = 1380333108

Four character code for "RF64".

static final int
RIFF_FOURCC = 1380533830

Four character code for "RIFF".

static final int

WAVE type value for 8-bit ITU-T G.711 A-law audio data.

static final int

WAVE type value for float PCM audio data.

static final int

WAVE type value for IMA ADPCM audio data.

static final int

WAVE type value for 8-bit ITU-T G.711 mu-law audio data.

static final int

WAVE type value for integer PCM audio data.

static final int

WAVE type value for extended WAVE format.

static final int
WAVE_FOURCC = 1463899717

Four character code for "WAVE".

Public methods

static int
@C.PcmEncoding
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.

static int

Returns the WAVE format type value for the given C.PcmEncoding.

Constants

DATA_FOURCC

public static final int DATA_FOURCC = 1684108385

Four character code for "data".

DS64_FOURCC

public static final int DS64_FOURCC = 1685272116

Four character code for "ds64".

FMT_FOURCC

public static final int FMT_FOURCC = 1718449184

Four character code for "fmt ".

RF64_FOURCC

public static final int RF64_FOURCC = 1380333108

Four character code for "RF64".

RIFF_FOURCC

public static final int RIFF_FOURCC = 1380533830

Four character code for "RIFF".

TYPE_ALAW

public static final int TYPE_ALAW = 6

WAVE type value for 8-bit ITU-T G.711 A-law audio data.

TYPE_FLOAT

public static final int TYPE_FLOAT = 3

WAVE type value for float PCM 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_PCM

public static final int TYPE_PCM = 1

WAVE type value for integer PCM audio data.

TYPE_WAVE_FORMAT_EXTENSIBLE

public static final int TYPE_WAVE_FORMAT_EXTENSIBLE = 65534

WAVE type value for extended WAVE format.

WAVE_FOURCC

public static final int WAVE_FOURCC = 1463899717

Four character code for "WAVE".

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 C.PcmEncoding value.

Returns
int

The corresponding WAVE format type.

Throws
java.lang.IllegalArgumentException

If pcmEncoding is not a C.PcmEncoding, or if it's ENCODING_INVALID or NO_VALUE.