X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=wavpack.git;a=blobdiff_plain;f=examples%2FWvInfo.hs;h=5e0b86fbe62bdbd020e6dc76bbbbcf78752808a3;hp=78588ab29d3e3f6e5cdf12f09f3a9124eacc824f;hb=79fe8094594b6b25d7d9c44bc128418d69f1da95;hpb=c819d2f4e89624b68af565e150a73e31149ab4a4 diff --git a/examples/WvInfo.hs b/examples/WvInfo.hs index 78588ab..5e0b86f 100644 --- a/examples/WvInfo.hs +++ b/examples/WvInfo.hs @@ -1,19 +1,24 @@ {-# LANGUAGE - UnicodeSyntax + UnboxedTuples + , UnicodeSyntax #-} module Main where import Codec.Audio.WavPack.Block import qualified Data.ByteString.Lazy as L +import qualified Data.Strict as S import System.Environment +import System.IO main ∷ IO () main = do [wvFile] ← getArgs wvStream ← L.readFile wvFile + hSetBuffering stdout NoBuffering showWvInfo wvStream showWvInfo ∷ L.ByteString → IO () showWvInfo stream - = case findNextHeader stream of - (Just bh, _) - → print bh - _ → fail "Can't find any WavPack block headers." + = case findNextBlock stream of + (# S.Just block, _ #) + → print block + (# S.Nothing , _ #) + → fail "Can't find any WavPack block headers."