Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module defines the **Alaw** audio sample type, as well as compading
conversion functions from/to S16
values.
- data ALaw
- encodeALawSample :: S16 -> ALaw
- decodeALawSample :: ALaw -> S16
- alawSample :: Iso' ALaw S16
- alawValue :: Iso' ALaw Word8
Documentation
A PCM audio sample represented by a single byte, that can be converted to a signed 13bit audio sample.
encodeALawSample :: S16 -> ALaw Source #
See http://opensource.apple.com//source/tcl/tcl-20/tcl_ext/snack/snack/generic/g711.c
Linear Input Code Compressed Code ----------------- --------------- 0000000wxyza 000wxyz 0000001wxyza 001wxyz 000001wxyzab 010wxyz 00001wxyzabc 011wxyz 0001wxyzabcd 100wxyz 001wxyzabcde 101wxyz 01wxyzabcdef 110wxyz 1wxyzabcdefg 111wxyz
For further information see John C. Bellamy's Digital Telephony, 1982, John Wiley & Sons, pps 98-111 and 472-476.
decodeALawSample :: ALaw -> S16 Source #
Uncompress an alaw sample into a linear 16 signed value, see
encodeALawSample
for more information.
alawSample :: Iso' ALaw S16 Source #
An Iso
between ALaw
and S16
using encodeALawSample
and
decodeALawSample
.