Enum Class PcmEncoding
- All Implemented Interfaces:
Serializable,Comparable<PcmEncoding>,Constable
RawPcmAudioSource and other linear-PCM
carriers in dtmf-io.
The encoding is orthogonal to endianness and bit depth: a raw PCM byte
buffer is fully described by the triple (bitDepth, byteOrder,
encoding), and RawPcmAudioSource's constructor takes all three as
separate parameters. This enum captures only the numeric-format dimension
of the tuple; little-endian vs big-endian is carried by
ByteOrder.
Not every (encoding, bitDepth) pair is valid. The cross-reference
table below is enforced by RawPcmAudioSource's constructor
validation (Requirements 7.7 and 7.8) and by the WAV provider's
fmt chunk parser:
SIGNED_INT— valid bit depths are{16, 24, 32, 64}. Two's-complement signed integer PCM; by far the most common encoding in the wild (WAVPCM_SIGNED, telephony recordings, CD audio).UNSIGNED_INT— valid bit depths are{16, 24, 32, 64}. Unsigned integer PCM, in which the midpoint2^(bitDepth - 1)represents silence. Rare at these bit depths (the classic unsigned-PCM use case is 8-bit WAV, which is out of scope for this module); supported here for generality.IEEE_FLOAT— valid bit depths are{32, 64}only. IEEE 754 floating point samples, already in[-1.0, 1.0]by convention and therefore read without scaling. Constructing aRawPcmAudioSourcewithIEEE_FLOATat16or24bits throwsIllegalArgumentException.
Bit depth 8 is not represented by any value of this enum because
the whole module targets 16, 24, 32, and 64
bits (Requirement 3.4). MP3 sources do not use this enum: they always
decode to signed 16-bit PCM and bypass the raw-PCM constructor path
entirely.
- Since:
- 2.1.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIEEE 754 floating-point PCM, already in[-1.0, 1.0]by convention and read without scaling.Two's-complement signed integer PCM.Unsigned integer PCM; the midpoint2^(bitDepth - 1)represents silence. -
Method Summary
Modifier and TypeMethodDescriptionstatic PcmEncodingReturns the enum constant of this class with the specified name.static PcmEncoding[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SIGNED_INT
Two's-complement signed integer PCM. Valid bit depths:{16, 24, 32, 64}. -
UNSIGNED_INT
Unsigned integer PCM; the midpoint2^(bitDepth - 1)represents silence. Valid bit depths:{16, 24, 32, 64}. -
IEEE_FLOAT
IEEE 754 floating-point PCM, already in[-1.0, 1.0]by convention and read without scaling. Valid bit depths:{32, 64}only.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-