X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=wavpack.git;a=blobdiff_plain;f=examples%2FWvInfo.hs;fp=examples%2FWvInfo.hs;h=78588ab29d3e3f6e5cdf12f09f3a9124eacc824f;hp=0000000000000000000000000000000000000000;hb=c819d2f4e89624b68af565e150a73e31149ab4a4;hpb=29798f163756481db542070067dee15501f281a6 diff --git a/examples/WvInfo.hs b/examples/WvInfo.hs new file mode 100644 index 0000000..78588ab --- /dev/null +++ b/examples/WvInfo.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE + UnicodeSyntax + #-} +module Main where +import Codec.Audio.WavPack.Block +import qualified Data.ByteString.Lazy as L +import System.Environment + +main ∷ IO () +main = do [wvFile] ← getArgs + wvStream ← L.readFile wvFile + showWvInfo wvStream + +showWvInfo ∷ L.ByteString → IO () +showWvInfo stream + = case findNextHeader stream of + (Just bh, _) + → print bh + _ → fail "Can't find any WavPack block headers."