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": duration| Constructor and Description |
|---|
WavRiffHandler(Metadata metadata) |
| Modifier and Type | Method and Description |
|---|---|
void |
addError(String message)
Registers an error message for consumption after extraction.
|
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)
RiffHandlerfalse causes processing to stop after reading only
the first twelve bytes of data.shouldAcceptRiffIdentifier in interface RiffHandleridentifier - The four character code identifying the type of RIFF datapublic boolean shouldAcceptChunk(String fourCC)
RiffHandlertrue 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 RiffHandlerfourCC - the four character code of this chunkRiffHandler.processChunk(String, byte[]) should be called, otherwise falsepublic boolean shouldAcceptList(String fourCC)
RiffHandlertrue if the chunks should continue being processed,
or false to avoid any unknown chunks within the list.shouldAcceptList in interface RiffHandlerfourCC - the four character code of this chunkRiffHandler.processChunk(String, byte[]) should be called, otherwise falsepublic void processChunk(String fourCC, byte[] payload)
RiffHandlerRiffHandler.shouldAcceptChunk(String)
with the same fourCC returned true.processChunk in interface RiffHandlerfourCC - the four character code of the chunkpayload - they payload of the chunk as a byte arraypublic void addError(String message)
RiffHandleraddError in interface RiffHandlermessage - the error messageCopyright © 2002-2020 Drew Noakes. All Rights Reserved.