WavPack decoder works in the same manner as FLAC decoder, with exception that there is no metadata blocks in the beggining of file, but metadata section in each WavPack block. This metadata is not as useful as FLAC metadata, though. Information about track title, album or performer is usualy stored in APEv2 tag in the end of file. So the algorithm for WavPack is usually this:
- Open a WavPack file/Get a stream with element type
(unsigned-byte 8). This step is the same as for FLAC format.
- Pass the stream to
wv:open-wvfunction which will create and return
bitreader:readerobject. Again, this is what you do when working with FLAC, just the function name differs.
- Read the first WavPack block with
wv:read-wv-block. It contains all information about channels, samplerate, etc. If the stream/file contains more than 2 channels (i.e. 5.1 audio), you can read multiple stereo or mono blocks with
- Decode the block with
wv:decode-wv-blockand repeat previous step.