zoom-cache-sndfile 0.1.1.0 → 0.2.0.0
raw patch · 2 files changed
+23/−6 lines, 2 filesdep ~zoom-cachedep ~zoom-cache-pcm
Dependency ranges changed: zoom-cache, zoom-cache-pcm
Files
- tools/zoom-cache-sndfile.hs +20/−3
- zoom-cache-sndfile.cabal +3/−3
tools/zoom-cache-sndfile.hs view
@@ -30,6 +30,8 @@ data Config = Config { noRaw :: Bool+ , delta :: Bool+ , zlib :: Bool , variable :: Bool , intData :: Bool , label :: ByteString@@ -44,6 +46,8 @@ defConfig :: Config defConfig = Config { noRaw = False+ , delta = False+ , zlib = False , variable = False , intData = False , label = "gen"@@ -53,6 +57,8 @@ } data Option = NoRaw+ | Delta+ | ZLib | Variable | IntData | Label String@@ -68,6 +74,10 @@ genOptions = [ Option ['z'] ["no-raw"] (NoArg NoRaw) "Do NOT include raw data in the output"+ , Option ['d'] ["delta"] (NoArg Delta)+ "Delta-encode data"+ , Option ['Z'] ["zlib"] (NoArg ZLib)+ "Zlib-compress data" , Option ['b'] ["variable"] (NoArg Variable) "Generate variable-rate data" , Option ['i'] ["integer"] (NoArg IntData)@@ -95,6 +105,10 @@ where processOneOption config NoRaw = do return $ config {noRaw = True}+ processOneOption config Delta = do+ return $ config {delta = True}+ processOneOption config ZLib = do+ return $ config {zlib = True} processOneOption config Variable = do return $ config {variable = True} processOneOption config IntData = do@@ -133,10 +147,10 @@ w :: (ZoomReadable a, ZoomWrite a, ZoomWrite (TimeStamp, a)) => [a] -> FilePath -> IO () w d- | variable = withFileWrite (oneTrack (head d) VariableDR rate' label)+ | variable = withFileWrite (oneTrack (head d) delta zlib VariableDR rate' label) (not noRaw) (sW >> mapM_ (write track) (zip (map TS [1,3..]) d))- | otherwise = withFileWrite (oneTrack (head d) ConstantDR rate' label)+ | otherwise = withFileWrite (oneTrack (head d) delta zlib ConstantDR rate' label) (not noRaw) (sW >> mapM_ (write track) d) rate' = fromInteger rate@@ -224,7 +238,10 @@ h <- SF.openFile path SF.ReadMode info let sfRate = fromIntegral (SF.samplerate . SF.hInfo $ h) - z <- openWrite (oneTrack (undefined :: PCM Double) ConstantDR sfRate "pcm")+ z <- openWrite (oneTrack (undefined :: PCM Double)+ False -- delta+ False -- zlib+ ConstantDR sfRate "pcm") True -- doRaw (path ++ ".zoom") z' <- foldFrames encodeBuffer z h 1024
zoom-cache-sndfile.cabal view
@@ -3,7 +3,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.1.1.0+Version: 0.2.0.0 Synopsis: Tools for generating zoom-cache-pcm files @@ -46,8 +46,8 @@ mtl >= 2.0.0.0 && < 3, ui-command, vector,- zoom-cache >= 0.6.0.0 && < 0.7,- zoom-cache-pcm >= 0.1.1.0 && < 0.2+ zoom-cache >= 0.7.0.0 && < 0.8,+ zoom-cache-pcm >= 0.2.0.0 && < 0.3 -- Other-modules: