Popularity
6.8
Growing
Activity
0.0
Stable
11
4
7
Monthly Downloads: 58
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags:
Codec
HCodecs alternatives and similar packages
Based on the "Codec" category.
Alternatively, view HCodecs alternatives based on common mentions on social networks and blogs.
-
binary-serialise-cbor
Binary serialisation in the CBOR format -
multihash-serialise
Haskell libraries for interacting with IPFS -
postgresql-binary
Encoders and decoders for the PostgreSQL's binary format -
html-entities
A codec library for HTML-escaped text and HTML-entities -
friday-juicypixels
Convert between friday and juicypixels types -
hs-zstd
Bindings to the Zstandard library to make it usable from the Haskell programming language. -
activitystreams-aeson
Basic library for working with Activity Streams -
libvorbis
Haskell binding for libvorbis, for decoding Ogg Vorbis audio files -
threefish
Haskell implementation of the Threefish block cipher and the Skein hash function built on it. -
logic-TPTP
Import, export etc. for TPTP, a syntax for first-order logic -
base32-z-bytestring
Efficient z-base32 codec for bytestrings. -
streaming-brotli
Streaming interface for Brotli (RFC7932) compression
Static code analysis for 29 languages.
Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.
Promo
www.sonarqube.org
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of HCodecs or a related project?
README
HCodecs - A library to read, write and manipulate MIDI, WAVE, and SoundFont2 files.
Code example
This programs generates a short WAV file "sample.wav", then reads it and prints each sample.
import Codec.Wav ( exportFile, importFile )
import Data.Audio ( Audio(Audio) )
import Data.Array.Unboxed ( listArray, elems )
import Data.Int ( Int32 )
import Data.Maybe ( fromMaybe )
import System.IO (FilePath)
filename = "sample.wav"
sinewave :: [Float]
sinewave = map (\x -> sin ((fromInteger x) / 10.0)) [1..10000]
outMain :: FilePath -> IO ()
outMain path = do
let fs :: [Float]
fs = sinewave
l = 1000
rate = 44100
-- Float is 32bit, so i use Int32 for each sample in the output.
let maxInt32 :: Float
maxInt32 = fromIntegral (maxBound::Int32)
-- actual transformation function
rounder :: Float -> Int32
rounder = round . (*maxInt32)
exportFile path ( Audio rate 1 -- 1 channel
$ listArray (0,l)
$ map rounder
$ fs)
inMain :: FilePath -> IO ()
inMain path = do
maybeAudio <- importFile path
case maybeAudio :: Either String (Audio Int32) of
Left s -> putStrLn $ "wav decoding error: " ++ s
Right (Audio rate channels samples) -> do
putStrLn $ "rate = " ++ show rate
putStrLn $ "channels: " ++ show channels
print $ elems samples
main = do
putStrLn $ "* Outputting the sound to "++filename
outMain filename
putStrLn $ "* Printing the content of "++filename
inMain filename
-- Original by hexagoxel @ freenode/#haskell
-- Modified by Vitaly "_Vi" Shukela