{-# LANGUAGE
UnicodeSyntax
#-}
+-- | Data types for WavPack codec.
module Codec.Audio.WavPack.Types
( BlockHeader(..)
)
import Data.Binary.Get
import Data.Binary.Put
+-- | The preamble to every block in both the .wv and .wvc files.
data BlockHeader
= BlockHeader {
+ -- | size of entire block (minus 8, of course)
bhSize ∷ !Word32
+ -- | 0x402 to 0x410 are currently valid for decode
, bhVersion ∷ !Word16
+ -- | track number (0 if not used, like now)
, bhTrackNo ∷ !Word8
+ -- | track sub-index (0 if not used, like now)
, bhIndexNo ∷ !Word8
+ -- | total samples for entire file, but this is only valid if
+ -- 'bhBlockIndex' == 0 and a value of -1 indicates unknown length
, bhTotalSamples ∷ !Word32
+ -- | index of first sample in block relative to beginning of
+ -- file (normally this would start at 0 for the first block)
, bhBlockIndex ∷ !Word32
+ -- | number of samples in this block (0 = no audio)
, bhBlockSamples ∷ !Word32
+ -- | various flags for id and decoding
, bhFlags ∷ !Word32
+ -- | crc for actual decoded data
, bhCRC ∷ !Word32
}
deriving (Show, Eq)
, bhFlags = flags
, bhCRC = crc
}
-
-{-
-typedef struct {
- char ckID [4]; // "wvpk"
- uint32_t ckSize; // size of entire block (minus 8, of course)
- uint16_t version; // 0x402 to 0x410 are currently valid for decode
- uchar track_no; // track number (0 if not used, like now)
- uchar index_no; // track sub-index (0 if not used, like now)
- uint32_t total_samples; // total samples for entire file, but this is
- // only valid if block_index == 0 and a value of
- // -1 indicates unknown length
- uint32_t block_index; // index of first sample in block relative to
- // beginning of file (normally this would start
- // at 0 for the first block)
- uint32_t block_samples; // number of samples in this block (0 = no audio)
- uint32_t flags; // various flags for id and decoding
- uint32_t crc; // crc for actual decoded data
-} WavpackHeader;
--}