public class WaveModule extends ModuleBase
Modifier and Type | Field and Description |
---|---|
protected AESAudioMetadata |
_aesMetadata |
protected int |
_blockAlign |
protected Checksummer |
_ckSummer
PRIVATE INSTANCE FIELDS.
|
protected ChecksumInputStream |
_cstream |
protected java.io.DataInputStream |
_dstream |
protected ExifInfo |
_exifInfo |
protected java.util.List<Property> |
_labeledText |
protected java.util.List<Property> |
_labels |
protected Property |
_metadata |
protected java.util.List<Property> |
_notes |
protected java.util.List<Property> |
_propList |
protected java.util.List<Property> |
_samples |
protected boolean |
broadcastExtChunkSeen |
protected int |
broadcastVersion |
protected long |
bytesRemaining |
protected boolean |
cartChunkSeen |
protected int |
compressionCode |
protected boolean |
cueChunkSeen |
protected boolean |
dataChunkSeen |
protected boolean |
factChunkSeen |
protected boolean |
firstSampleOffsetMarked |
protected boolean |
flagBroadcastWave |
protected boolean |
flagPCMWaveFormat |
protected boolean |
flagWaveFormatEx |
protected boolean |
flagWaveFormatExtensible |
protected boolean |
formatChunkSeen |
protected boolean |
instrumentChunkSeen |
protected boolean |
linkChunkSeen |
protected boolean |
mpegChunkSeen |
protected long |
numSamples |
protected boolean |
peakChunkSeen |
protected long |
sampleRate |
_app, _bigEndian, _checksumFinished, _countStream, _coverage, _crc32, _date, _defaultParams, _features, _format, _init, _isRandomAccess, _je, _logger, _md5, _mimeType, _name, _nByte, _note, _param, _release, _repInfoNote, _rights, _sha1, _signature, _specification, _validityNote, _vendor, _verbosity, _wellFormedNote
MAXIMUM_VERBOSITY, MINIMUM_VERBOSITY
Constructor and Description |
---|
WaveModule()
Instantiates an WaveModule object.
|
Modifier and Type | Method and Description |
---|---|
void |
addLabel(Property p)
Adds a Label property
|
void |
addLabeledText(Property p)
Adds a LabeledText property
|
void |
addListInfo(java.util.List l)
Adds the ListInfo property, which is a List of String Properties.
|
void |
addNote(Property p)
Adds a Note string
|
void |
addSample(Property p)
Adds a Sample property
|
void |
addSamples(long samples)
Add to the number of data bytes.
|
void |
addWaveProperty(Property prop)
Adds a Property to the WAVE metadata.
|
Property |
buildBitmaskProperty(int val,
java.lang.String name,
java.lang.String[] oneValueNames,
java.lang.String[] zeroValueNames)
General function for adding a property with a 32-bit
value, with two arrays of Strings to interpret
0 and 1 values as a bitmask.
|
protected void |
dupChunkError(RepInfo info,
java.lang.String chunkName) |
AESAudioMetadata |
getAESMetadata()
Returns the module's AES metadata.
|
int |
getBlockAlign()
Returns the number of bytes needed per aligned
sample.
|
int |
getCompressionCode()
Returns the compression code.
|
ExifInfo |
getExifInfo()
Returns the ExifInfo object.
|
protected void |
initParse()
Initializes the state of the module for parsing.
|
void |
markFirstSampleOffset()
Marks the first sample offset as the current byte position,
if it hasn't already been marked.
|
int |
parse(java.io.InputStream stream,
RepInfo info,
int parseIndex)
Parses the content of a purported WAVE digital object and stores the
results in RepInfo.
|
java.lang.String |
read4Chars(java.io.DataInputStream stream)
Reads 4 bytes and concatenates them into a String.
|
protected boolean |
readChunk(RepInfo info)
Reads a WAVE Chunk.
|
int |
readSignedInt(java.io.DataInputStream stream)
One-argument version of
readSignedInt . |
long |
readSignedLong(java.io.DataInputStream stream)
One-argument version of
readSignedLong . |
int |
readSignedShort(java.io.DataInputStream stream)
One-argument version of
readSignedShort . |
long |
readUnsignedInt(java.io.DataInputStream stream)
One-argument version of
readUnsignedInt . |
int |
readUnsignedShort(java.io.DataInputStream stream)
One-argument version of
readUnsignedShort . |
void |
setBlockAlign(int align)
Set the number of bytes that holds an aligned sample.
|
void |
setBroadcastVersion(int version)
Set the version from the Broadcast Extension chunk.
|
void |
setBroadcastWave(boolean b)
Set the profile flag for Broadcast Wave.
|
void |
setCompressionCode(int cf)
Set the compression format.
|
void |
setExifInfo(ExifInfo exifInfo)
Sets an ExifInfo object for the module.
|
void |
setPCMWaveFormat(boolean b)
Set the profile flag for PCMWAVEFORMAT.
|
void |
setSampleRate(long rate)
Set the sample rate.
|
void |
setWaveFormatEx(boolean b)
Set the profile flag for WAVEFORMATEX.
|
void |
setWaveFormatExtensible(boolean b)
Set the profile flag for WAVEFORMATEXTENSIBLE.
|
addIntegerProperty, addIntegerProperty, applyDefaultParams, calcRAChecksum, checkSignatures, checkSignatures, getApp, getBase, getBufferedDataStream, getCoverage, getCRC32, getDate, getDefaultParams, getFeatures, getFormat, getMimeType, getName, getNByte, getNote, getRelease, getRepInfoNote, getRights, getSignature, getSpecification, getValidityNote, getVendor, getWellFormedNote, hasFeature, init, initFeatures, isBigEndian, isRandomAccess, param, parse, readByteBuf, readDouble, readDouble, readDouble, readFloat, readFloat, readSignedByte, readSignedByte, readSignedByte, readSignedInt, readSignedInt, readSignedInt, readSignedLong, readSignedRational, readSignedRational, readSignedShort, readSignedShort, readSignedShort, readUnsignedByte, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedInt, readUnsignedRational, readUnsignedRational, readUnsignedRational, readUnsignedShort, readUnsignedShort, readUnsignedShort, resetParams, setApp, setBase, setChecksums, setCRC32, setDefaultParams, setMD5, setNByte, setSHA1, setValidityNote, setVerbosity, show, skipBytes, skipBytes, vectorToPropArray
protected Checksummer _ckSummer
protected ChecksumInputStream _cstream
protected java.io.DataInputStream _dstream
protected Property _metadata
protected java.util.List<Property> _propList
protected java.util.List<Property> _notes
protected java.util.List<Property> _labels
protected java.util.List<Property> _labeledText
protected java.util.List<Property> _samples
protected AESAudioMetadata _aesMetadata
protected long bytesRemaining
protected int _blockAlign
protected ExifInfo _exifInfo
protected int compressionCode
protected long numSamples
protected long sampleRate
protected boolean formatChunkSeen
protected boolean factChunkSeen
protected boolean dataChunkSeen
protected boolean instrumentChunkSeen
protected boolean mpegChunkSeen
protected boolean cartChunkSeen
protected boolean broadcastExtChunkSeen
protected boolean peakChunkSeen
protected boolean linkChunkSeen
protected boolean cueChunkSeen
protected boolean flagPCMWaveFormat
protected boolean flagWaveFormatEx
protected boolean flagWaveFormatExtensible
protected boolean flagBroadcastWave
protected int broadcastVersion
protected boolean firstSampleOffsetMarked
public int parse(java.io.InputStream stream, RepInfo info, int parseIndex) throws java.io.IOException
parse
in interface Module
parse
in class ModuleBase
stream
- An InputStream, positioned at its beginning,
which is generated from the object to be parsedinfo
- A fresh RepInfo object which will be modified
to reflect the results of the parsingparseIndex
- Must be 0 in first call to parse
. If
parse
returns a nonzero value, it must be
called again with parseIndex
equal to that return value.java.io.IOException
public void markFirstSampleOffset()
public void setExifInfo(ExifInfo exifInfo)
public void setBlockAlign(int align)
public ExifInfo getExifInfo()
public int getCompressionCode()
public int getBlockAlign()
public void addWaveProperty(Property prop)
public void addLabel(Property p)
public void addLabeledText(Property p)
public void addSample(Property p)
public void addNote(Property p)
public void addListInfo(java.util.List l)
public long readSignedLong(java.io.DataInputStream stream) throws java.io.IOException
readSignedLong
.
WAVE is always little-endian, so readSignedInt can
unambiguously drop its endian argument.java.io.IOException
public long readUnsignedInt(java.io.DataInputStream stream) throws java.io.IOException
readUnsignedInt
.
WAVE is always little-endian, so readUnsignedInt can
unambiguously drop its endian argument.java.io.IOException
public int readSignedInt(java.io.DataInputStream stream) throws java.io.IOException
readSignedInt
.
WAVE is always little-endian, so readSignedInt can
unambiguously drop its endian argument.java.io.IOException
public int readUnsignedShort(java.io.DataInputStream stream) throws java.io.IOException
readUnsignedShort
.
WAVE is always little-endian, so readUnsignedShort can
unambiguously drop its endian argument.java.io.IOException
public int readSignedShort(java.io.DataInputStream stream) throws java.io.IOException
readSignedShort
.
WAVE is always little-endian, so readSignedShort can
unambiguously drop its endian argument.java.io.IOException
public java.lang.String read4Chars(java.io.DataInputStream stream) throws java.io.IOException
java.io.IOException
public void setCompressionCode(int cf)
public void addSamples(long samples)
public void setSampleRate(long rate)
public void setPCMWaveFormat(boolean b)
public void setWaveFormatEx(boolean b)
public void setWaveFormatExtensible(boolean b)
public void setBroadcastWave(boolean b)
public void setBroadcastVersion(int version)
protected void initParse()
initParse
in class ModuleBase
protected boolean readChunk(RepInfo info) throws java.io.IOException
java.io.IOException
public AESAudioMetadata getAESMetadata()
protected void dupChunkError(RepInfo info, java.lang.String chunkName)
public Property buildBitmaskProperty(int val, java.lang.String name, java.lang.String[] oneValueNames, java.lang.String[] zeroValueNames)
val
- The bitmaskname
- The name for the PropertyoneValueNames
- Array of names to use for '1' valueszeroValueNames
- Array of names to use for '0' values