Dims
Dims

Reputation: 51239

What AudioFormat.Encoding constructor parameter means?

The manual does not answer this question: it says "the name of the new type of encoding".

Is this just an arbitrary name like filename? Or this is some predefined name, like in Charset.forName() method?

In latter case where can I find the list of supported sound encodings?

Upvotes: 0

Views: 271

Answers (1)

ulmangt
ulmangt

Reputation: 5423

Check our the source code for: AudioFormat.java. At the bottom of the class it constructs four pre-defined encodings:

  1. PCM_SIGNED = new Encoding("PCM_SIGNED");
  2. PCM_UNSIGNED = new Encoding("PCM_UNSIGNED");
  3. ULAW = new Encoding("ULAW");
  4. ALAW = new Encoding("ALAW");

The String is used in the equals() and hashCode() implementations for AudioFormat.Encoding, so it certainly is intended to serve the purpose of a unique identifier for the encoding.

Upvotes: 2

Related Questions