WavPackage
Inheritance: java.lang.Object, com.groupdocs.metadata.core.MetadataPackage, com.groupdocs.metadata.core.CustomPackage
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()); } }
Constructors
Constructor | Description |
---|---|
WavPackage() | Initializes a new instance of the WavPackage class. |
Methods
Method | Description |
---|---|
getAudioFormat() | Gets the audio format. |
getNumberOfChannels() | Gets the number of channels. |
getSampleRate() | Gets the sample rate. |
getByteRate() | Gets the byte rate. |
getBlockAlign() | Gets the block align. |
getBitsPerSample() | Gets the bits per sample value. |
WavPackage()
public WavPackage()
Initializes a new instance of the WavPackage class.
getAudioFormat()
public final int getAudioFormat()
Gets the audio format. PCM = 1 (i.e. Linear quantization). Values other than 1 indicate some form of compression.
Returns: int - The audio format.
getNumberOfChannels()
public final int getNumberOfChannels()
Gets the number of channels.
Returns: int - The number of channels.
getSampleRate()
public final int getSampleRate()
Gets the sample rate.
Returns: int - The sample rate.
getByteRate()
public final int getByteRate()
Gets the byte rate.
Returns: int - The byte rate.
getBlockAlign()
public final int getBlockAlign()
Gets the block align.
Returns: int - The block align.
getBitsPerSample()
public final int getBitsPerSample()
Gets the bits per sample value.
Returns: int - The bits per sample value.