]> gitweb @ CieloNegro.org - wavpack.git/blobdiff - examples/WvInfo.hs
DecorrTerms
[wavpack.git] / examples / WvInfo.hs
index 4c5cf88cf6b6c895021382b9617459467faae16a..5e0b86fbe62bdbd020e6dc76bbbbcf78752808a3 100644 (file)
@@ -1,20 +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
-        Nothing
+    = case findNextBlock stream of
+        (# S.Just block, _ #)
+            → print block
+        (# S.Nothing   , _ #)
             → fail "Can't find any WavPack block headers."