- java.lang.Object
-
- javax.sound.sampled.AudioFormat.Encoding
-
- Enclosing class:
- AudioFormat
public static class AudioFormat.Encoding extends Object
TheEncoding
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 may be signed or unsigned integers or floats. 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, and make these available through the
class.AudioSystem
The
Encoding
class is static, so that allAudioFormat
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.- Since:
- 1.3
- See Also:
AudioFormat
,FormatConversionProvider
-
-
Field Summary
Fields Modifier and Type Field and Description static AudioFormat.Encoding
ALAW
Specifies a-law encoded data.static AudioFormat.Encoding
PCM_FLOAT
Specifies floating-point PCM 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
Constructors Constructor and Description AudioFormat.Encoding(String name)
Constructs a new encoding.
-
-
-
Field Detail
-
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.
-
PCM_FLOAT
public static final AudioFormat.Encoding PCM_FLOAT
Specifies floating-point PCM data.- Since:
- 1.7
-
ULAW
public static final AudioFormat.Encoding ULAW
Specifies u-law encoded data.
-
ALAW
public static final AudioFormat.Encoding ALAW
Specifies a-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 classObject
- Parameters:
obj
- the reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.- See Also:
Object.hashCode()
,HashMap
-
hashCode
public final int hashCode()
Finalizes the hashCode method- Overrides:
hashCode
in classObject
- Returns:
- a hash code value for this object.
- See Also:
Object.equals(java.lang.Object)
,System.identityHashCode(java.lang.Object)
-
toString
public final String toString()
Provides theString
representation of the encoding. ThisString
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".
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
21/11/2024 22:13:31 Cette version de la page est en cache (à la date du 21/11/2024 22:13:31) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 01/09/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/sound/sampled/audioformat.encoding.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.