public class WavRiffHandler extends Object implements RiffHandler
RiffHandler
specialising in Wav support.
Extracts data from chunk/list types:
"INFO"
: artist, title, product, track number, date created, genre, comments, copyright, software, duration"fmt "
: format, channels, samples/second, bytes/second, block alignment, bits/sample"data"
: durationConstructor and Description |
---|
WavRiffHandler(Metadata metadata) |
Modifier and Type | Method and Description |
---|---|
void |
processChunk(String fourCC,
byte[] payload)
Perform whatever processing is necessary for the type of chunk with its
payload.
|
boolean |
shouldAcceptChunk(String fourCC)
Gets whether this handler is interested in the specific chunk type.
|
boolean |
shouldAcceptList(String fourCC)
Gets whether this handler is interested in the specific list type.
|
boolean |
shouldAcceptRiffIdentifier(String identifier)
Gets whether the specified RIFF identifier is of interest to this handler.
|
public WavRiffHandler(Metadata metadata)
public boolean shouldAcceptRiffIdentifier(String identifier)
RiffHandler
false
causes processing to stop after reading only
the first twelve bytes of data.shouldAcceptRiffIdentifier
in interface RiffHandler
identifier
- The four character code identifying the type of RIFF datapublic boolean shouldAcceptChunk(String fourCC)
RiffHandler
true
if the data should be copied into an array and passed
to RiffHandler.processChunk(String, byte[])
, or false
to avoid
the copy and skip to the next chunk in the file, if any.shouldAcceptChunk
in interface RiffHandler
fourCC
- the four character code of this chunkRiffHandler.processChunk(String, byte[])
should be called, otherwise falsepublic boolean shouldAcceptList(String fourCC)
RiffHandler
true
if the chunks should continue being processed,
or false
to avoid any unknown chunks within the list.shouldAcceptList
in interface RiffHandler
fourCC
- the four character code of this chunkRiffHandler.processChunk(String, byte[])
should be called, otherwise falsepublic void processChunk(String fourCC, byte[] payload)
RiffHandler
RiffHandler.shouldAcceptChunk(String)
with the same fourCC
returned true
.processChunk
in interface RiffHandler
fourCC
- the four character code of the chunkpayload
- they payload of the chunk as a byte arrayCopyright © 2024. All rights reserved.