mediabus-0.4.0.1: Multimedia streaming on top of Conduit

Safe HaskellNone
LanguageHaskell2010

Data.MediaBus.Media.Audio.Raw.Alaw

Description

This module defines the **Alaw** audio sample type, as well as compading conversion functions from/to S16 values.

Synopsis

Documentation

data ALaw Source #

A PCM audio sample represented by a single byte, that can be converted to a signed 13bit audio sample.

Instances

Eq ALaw Source # 

Methods

(==) :: ALaw -> ALaw -> Bool #

(/=) :: ALaw -> ALaw -> Bool #

Num ALaw Source # 

Methods

(+) :: ALaw -> ALaw -> ALaw #

(-) :: ALaw -> ALaw -> ALaw #

(*) :: ALaw -> ALaw -> ALaw #

negate :: ALaw -> ALaw #

abs :: ALaw -> ALaw #

signum :: ALaw -> ALaw #

fromInteger :: Integer -> ALaw #

Show ALaw Source # 

Methods

showsPrec :: Int -> ALaw -> ShowS #

show :: ALaw -> String #

showList :: [ALaw] -> ShowS #

Generic ALaw Source # 

Associated Types

type Rep ALaw :: * -> * #

Methods

from :: ALaw -> Rep ALaw x #

to :: Rep ALaw x -> ALaw #

Arbitrary ALaw Source # 

Methods

arbitrary :: Gen ALaw #

shrink :: ALaw -> [ALaw] #

Storable ALaw Source # 

Methods

sizeOf :: ALaw -> Int #

alignment :: ALaw -> Int #

peekElemOff :: Ptr ALaw -> Int -> IO ALaw #

pokeElemOff :: Ptr ALaw -> Int -> ALaw -> IO () #

peekByteOff :: Ptr b -> Int -> IO ALaw #

pokeByteOff :: Ptr b -> Int -> ALaw -> IO () #

peek :: Ptr ALaw -> IO ALaw #

poke :: Ptr ALaw -> ALaw -> IO () #

Bits ALaw Source # 
Default ALaw Source # 

Methods

def :: ALaw #

NFData ALaw Source # 

Methods

rnf :: ALaw -> () #

CanBeBlank ALaw Source # 

Methods

blank :: ALaw Source #

IsPcmValue ALaw Source # 

Methods

pcmAverage :: ALaw -> ALaw -> ALaw Source #

type Rep ALaw Source # 
type Rep ALaw = D1 (MetaData "ALaw" "Data.MediaBus.Media.Audio.Raw.Alaw" "mediabus-0.4.0.1-KxOztWIrQ7SL9k5ZMcQI4H" True) (C1 (MetaCons "MkALaw" PrefixI True) (S1 (MetaSel (Just Symbol "_alawValue") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Word8)))

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.

alawValue :: Iso' ALaw Word8 Source #

An Iso for ALaw sample values.