This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.sound.sampled
class AudioFormat.Encoding

java.lang.Object extended by javax.sound.sampled.AudioFormat.Encoding
Enclosing class:
AudioFormat

public static class AudioFormat.Encoding
extends Object

The Encoding class names the specific type of data representation used for an audio stream. The encoding includes aspects of the sound format other than the number of channels, sample rate, sample size, frame rate, frame size, and byte order.

One ubiquitous type of audio encoding is pulse-code modulation (PCM), which is simply a linear (proportional) representation of the sound waveform. With PCM, the number stored in each sample is proportional to the instantaneous amplitude of the sound pressure at that point in time. The numbers are frequently signed or unsigned integers. Besides PCM, other encodings include mu-law and a-law, which are nonlinear mappings of the sound amplitude that are often used for recording speech.

You can use a predefined encoding by referring to one of the static objects created by this class, such as PCM_SIGNED or PCM_UNSIGNED. Service providers can create new encodings, such as compressed audio formats or floating-point PCM samples, and make these available through the {@link AudioSystem} class.

The Encoding class is static, so that all AudioFormat objects that have the same encoding will refer to the same object (rather than different instances of the same class). This allows matches to be made by checking that two format's encodings are equal.


Field Summary
static AudioFormat.Encoding ALAW
          Specifies a-law encoded data.
static AudioFormat.Encoding PCM_SIGNED
          Specifies signed, linear PCM data.
static AudioFormat.Encoding PCM_UNSIGNED
          Specifies unsigned, linear PCM data.
static AudioFormat.Encoding ULAW
          Specifies u-law encoded data.
 
Constructor Summary

          Constructs a new encoding.
 
Method Summary
 boolean

          Finalizes the equals method
 int

          Finalizes the hashCode method
 String

          Provides the String representation of the encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALAW

public static final AudioFormat.Encoding ALAW
Specifies a-law encoded data.

PCM_SIGNED

public static final AudioFormat.Encoding PCM_SIGNED
Specifies signed, linear PCM data.

PCM_UNSIGNED

public static final AudioFormat.Encoding PCM_UNSIGNED
Specifies unsigned, linear PCM data.

ULAW

public static final AudioFormat.Encoding ULAW
Specifies u-law encoded data.
Constructor Detail

AudioFormat.Encoding

public AudioFormat.Encoding(String name)
Constructs a new encoding.

Parameters:
name - the name of the new type of encoding
Method Detail

equals

public final boolean equals(Object obj)
Finalizes the equals method

Overrides:
equals in class Object
Parameters:
obj

hashCode

public final int hashCode()
Finalizes the hashCode method

Overrides:
hashCode in class Object

toString

public final String toString()
Provides the String representation of the encoding. This String is the same name that was passed to the constructor. For the predefined encodings, the name is similar to the encoding's variable (field) name. For example, PCM_SIGNED.toString() returns the name "pcm_signed".

Overrides:
toString in class Object
Returns:
the encoding name


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.