]> gitweb @ CieloNegro.org - wavpack.git/blobdiff - examples/WvInfo.hs
WvInfo.hs
[wavpack.git] / examples / WvInfo.hs
diff --git a/examples/WvInfo.hs b/examples/WvInfo.hs
new file mode 100644 (file)
index 0000000..78588ab
--- /dev/null
@@ -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."