public final class WavPackage extends CustomPackage
Represents a native metadata package in a WAV audio file.
This code sample shows how to extract technical audio information from a WAV file.
try (Metadata metadata = new Metadata(Constants.InputWav)) { WavRootPackage root = metadata.getRootPackageGeneric(); if (root.getWavPackage() != null) { System.out.println(root.getWavPackage().getAudioFormat()); System.out.println(root.getWavPackage().getBitsPerSample()); System.out.println(root.getWavPackage().getBlockAlign()); System.out.println(root.getWavPackage().getByteRate()); System.out.println(root.getWavPackage().getNumberOfChannels()); System.out.println(root.getWavPackage().getSampleRate()); } }
Constructor and Description |
---|
WavPackage()
Initializes a new instance of the
WavPackage class. |
Modifier and Type | Method and Description |
---|---|
int |
getAudioFormat()
Gets the audio format.
|
int |
getBitsPerSample()
Gets the bits per sample value.
|
int |
getBlockAlign()
Gets the block align.
|
int |
getByteRate()
Gets the byte rate.
|
int |
getNumberOfChannels()
Gets the number of channels.
|
int |
getSampleRate()
Gets the sample rate.
|
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, sanitize, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public WavPackage()
Initializes a new instance of the WavPackage
class.
public final int getAudioFormat()
Gets the audio format. PCM = 1 (i.e. Linear quantization). Values other than 1 indicate some form of compression.
public final int getNumberOfChannels()
Gets the number of channels.
public final int getSampleRate()
Gets the sample rate.
public final int getByteRate()
Gets the byte rate.
public final int getBlockAlign()
Gets the block align.
public final int getBitsPerSample()
Gets the bits per sample value.