]> gitweb @ CieloNegro.org - wavpack.git/blobdiff - examples/WvInfo.hs
findNextBlock
[wavpack.git] / examples / WvInfo.hs
index 78588ab29d3e3f6e5cdf12f09f3a9124eacc824f..8b1f5b4dfdafbf659d46b34fc136e972ace9a5f5 100644 (file)
@@ -1,9 +1,11 @@
 {-# 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
 
 main ∷ IO ()
@@ -13,7 +15,8 @@ main = do [wvFile] ← getArgs
 
 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."