alsa-pcm-0.6.1: Binding to the ALSA Library API (PCM audio).

Safe HaskellSafe
LanguageHaskell2010

Sound.ALSA.PCM.Node.ALSA

Contents

Synopsis

Types

data Handle i y #

Instances
Storable (Handle i y) # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

Methods

sizeOf :: Handle i y -> Int #

alignment :: Handle i y -> Int #

peekElemOff :: Ptr (Handle i y) -> Int -> IO (Handle i y) #

pokeElemOff :: Ptr (Handle i y) -> Int -> Handle i y -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Handle i y) #

pokeByteOff :: Ptr b -> Int -> Handle i y -> IO () #

peek :: Ptr (Handle i y) -> IO (Handle i y) #

poke :: Ptr (Handle i y) -> Handle i y -> IO () #

data Stream #

Instances
Bounded Stream # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

Enum Stream # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

Eq Stream # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

Methods

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

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

Show Stream # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

data Mode #

Instances
Semigroup Mode # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

Methods

(<>) :: Mode -> Mode -> Mode #

sconcat :: NonEmpty Mode -> Mode #

stimes :: Integral b => b -> Mode -> Mode #

Monoid Mode # 
Instance details

Defined in Sound.ALSA.PCM.Core.Handle

Methods

mempty :: Mode #

mappend :: Mode -> Mode -> Mode #

mconcat :: [Mode] -> Mode #

modes :: [Mode] -> Mode #

data Interleaved #

Instances
Access Interleaved # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

access :: T Interleaved y Access

setChannels :: C y => T Interleaved y ()

data Noninterleaved #

Instances
Access Noninterleaved # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

access :: T Noninterleaved y Access

setChannels :: C y => T Noninterleaved y ()

type Time = Int #

type Size = Int #

Classes

class Access i #

Minimal complete definition

access, setChannels

Instances
Access Noninterleaved # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

access :: T Noninterleaved y Access

setChannels :: C y => T Noninterleaved y ()

Access Interleaved # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

access :: T Interleaved y Access

setChannels :: C y => T Interleaved y ()

class (Storable y, C y) => SampleFmt y #

Minimal complete definition

sampleFmtToPcmFormat

Instances
SampleFmt Double # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Double -> Format #

SampleFmt Float # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Float -> Format #

SampleFmt Int8 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Int8 -> Format #

SampleFmt Int16 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Int16 -> Format #

SampleFmt Int32 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Int32 -> Format #

SampleFmt Word8 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Word8 -> Format #

SampleFmt Word16 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Word16 -> Format #

SampleFmt Word32 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: Word32 -> Format #

SampleFmt T # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: T -> Format #

SampleFmt a => SampleFmt (T a) # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Methods

sampleFmtToPcmFormat :: T a -> Format #

class SampleFmt y => MonoSampleFmt y #

Sample types of this class must have exactly one channel, i.e. Frame.numberOfChannels == 1.

Instances
MonoSampleFmt Double # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Float # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Int8 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Int16 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Int32 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Word8 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Word16 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt Word32 # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

MonoSampleFmt T # 
Instance details

Defined in Sound.ALSA.PCM.Core.Class

Management of streams

open #

Arguments

:: (Access i, SampleFmt y) 
=> Mode 
-> Stream 
-> T i y a 
-> (a -> T i y b) 
-> String

device, e.g "default"

-> IO (b, Handle i y) 

close :: Handle i y -> IO () #

prepare :: Handle i y -> IO () #

start :: Handle i y -> IO () #

drop :: Handle i y -> IO () #

drain :: Handle i y -> IO () #

Data transfer

readiRetry :: SampleFmt y => Handle Interleaved y -> Ptr y -> Size -> IO Size #

retry on buffer over-run

writeiRetry :: SampleFmt y => Handle Interleaved y -> Ptr y -> Size -> IO Size #

retry on buffer under-run

readn :: MonoSampleFmt y => Handle Noninterleaved y -> Ptr (Ptr y) -> Size -> IO Size #

The Ptr (Ptr y) argument is actually a pointer to an array of pointers. The array must have the size of number of channels. In Noninterleaved mode you must set the number of channels manually using setChannels or its friends. It is an unchecked error if the number of channels set with setChannels does not match the array size in the readn call.