WavUtil
@UnstableApi
class WavUtil
Utilities for handling WAVE files.
Summary
Constants |
|
|---|---|
const Int |
DATA_FOURCC = 1684108385Four character code for "data". |
const Int |
DS64_FOURCC = 1685272116Four character code for "ds64". |
const Int |
FACT_FOURCC = 1717658484Four character code for "fact". |
const Int |
FMT_FOURCC = 1718449184Four character code for "fmt ". |
const Int |
RF64_FOURCC = 1380333108Four character code for "RF64". |
const Int |
RIFF_FOURCC = 1380533830Four character code for "RIFF". |
const Int |
TYPE_ALAW = 6WAVE type value for 8-bit ITU-T G.711 A-law audio data. |
const Int |
TYPE_FLOAT = 3WAVE type value for float PCM audio data. |
const Int |
TYPE_IMA_ADPCM = 17WAVE type value for IMA ADPCM audio data. |
const Int |
TYPE_MLAW = 7WAVE type value for 8-bit ITU-T G.711 mu-law audio data. |
const Int |
TYPE_PCM = 1WAVE type value for integer PCM audio data. |
const Int |
TYPE_WAVE_FORMAT_EXTENSIBLE = 65534WAVE type value for extended WAVE format. |
const Int |
WAVE_FOURCC = 1463899717Four character code for "WAVE". |
Public functions |
|
|---|---|
java-static Int |
@C.PcmEncodingReturns the |
java-static Int |
getTypeForPcmEncoding(@C.PcmEncoding pcmEncoding: Int)Returns the WAVE format type value for the given |
java-static Boolean |
isChannelMaskValid(channelMask: Int, channelCount: Int)Checks whether the given Microsoft WAVE channel mask is valid and matches the channel count. |
java-static Int |
mapToAudioFormatChannelMask(wavChannelMask: Int)Maps the given Microsoft WAVE channel mask to the corresponding Android |
Constants
TYPE_WAVE_FORMAT_EXTENSIBLE
const val TYPE_WAVE_FORMAT_EXTENSIBLE = 65534: Int
WAVE type value for extended WAVE format.
Public functions
getPcmEncodingForType
@C.PcmEncoding
java-static fun getPcmEncodingForType(type: Int, bitsPerSample: Int): Int
Returns the C.PcmEncoding for the given WAVE format type value, or ENCODING_INVALID if the type is not a known PCM type.
getTypeForPcmEncoding
java-static fun getTypeForPcmEncoding(@C.PcmEncoding pcmEncoding: Int): Int
Returns the WAVE format type value for the given C.PcmEncoding.
| Parameters | |
|---|---|
@C.PcmEncoding pcmEncoding: Int |
The |
| Returns | |
|---|---|
Int |
The corresponding WAVE format type. |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
isChannelMaskValid
java-static fun isChannelMaskValid(channelMask: Int, channelCount: Int): Boolean
Checks whether the given Microsoft WAVE channel mask is valid and matches the channel count.
| Returns | |
|---|---|
Boolean |
Whether the channel mask is valid. |
mapToAudioFormatChannelMask
java-static fun mapToAudioFormatChannelMask(wavChannelMask: Int): Int
Maps the given Microsoft WAVE channel mask to the corresponding Android android.media.AudioFormat channel mask.
| Parameters | |
|---|---|
wavChannelMask: Int |
The WAVE channel mask. |
| Returns | |
|---|---|
Int |
The mapped |