alsa-0.2: Binding to the ALSA Library API.Source codeContentsIndex
Sound.Alsa
Synopsis
data SampleFmt
= SampleFmtLinear16BitSignedLE
| SampleFmtMuLaw8Bit
type SampleFreq = Int
data SoundFmt = SoundFmt {
sampleFmt :: SampleFmt
sampleFreq :: SampleFreq
numChannels :: Int
}
data SoundSource handle = SoundSource {
soundSourceFmt :: SoundFmt
soundSourceOpen :: IO handle
soundSourceClose :: handle -> IO ()
soundSourceStart :: handle -> IO ()
soundSourceStop :: handle -> IO ()
soundSourceRead :: handle -> Ptr () -> Int -> IO Int
}
data SoundSink handle = SoundSink {
soundSinkFmt :: SoundFmt
soundSinkOpen :: IO handle
soundSinkClose :: handle -> IO ()
soundSinkWrite :: handle -> Ptr () -> Int -> IO ()
soundSinkStart :: handle -> IO ()
soundSinkStop :: handle -> IO ()
}
withSoundSource :: SoundSource h -> (h -> IO a) -> IO a
withSoundSourceRunning :: SoundSource h -> h -> IO a -> IO a
withSoundSink :: SoundSink h -> (h -> IO a) -> IO a
withSoundSinkRunning :: SoundSink h -> h -> IO a -> IO a
soundFmtMIME :: SoundFmt -> String
audioBytesPerSample :: SoundFmt -> Int
audioBytesPerFrame :: SoundFmt -> Int
soundSourceBytesPerFrame :: SoundSource h -> Int
soundSinkBytesPerFrame :: SoundSink h -> Int
soundSourceReadBytes :: SoundSource h -> h -> Ptr () -> Int -> IO Int
soundSinkWriteBytes :: SoundSink h -> h -> Ptr () -> Int -> IO ()
copySound :: SoundSource h1 -> SoundSink h2 -> Int -> IO ()
alsaSoundSource :: String -> SoundFmt -> SoundSource Pcm
alsaSoundSink :: String -> SoundFmt -> SoundSink Pcm
fileSoundSource :: FilePath -> SoundFmt -> SoundSource Handle
fileSoundSink :: FilePath -> SoundFmt -> SoundSink Handle
Documentation
data SampleFmt Source
Constructors
SampleFmtLinear16BitSignedLE
SampleFmtMuLaw8Bit
show/hide Instances
type SampleFreq = IntSource
data SoundFmt Source
Constructors
SoundFmt
sampleFmt :: SampleFmt
sampleFreq :: SampleFreq
numChannels :: Int
show/hide Instances
data SoundSource handle Source
Counts are in samples, not bytes. Multi-channel data is interleaved.
Constructors
SoundSource
soundSourceFmt :: SoundFmt
soundSourceOpen :: IO handle
soundSourceClose :: handle -> IO ()
soundSourceStart :: handle -> IO ()
soundSourceStop :: handle -> IO ()
soundSourceRead :: handle -> Ptr () -> Int -> IO Int
data SoundSink handle Source
Constructors
SoundSink
soundSinkFmt :: SoundFmt
soundSinkOpen :: IO handle
soundSinkClose :: handle -> IO ()
soundSinkWrite :: handle -> Ptr () -> Int -> IO ()
soundSinkStart :: handle -> IO ()
soundSinkStop :: handle -> IO ()
withSoundSource :: SoundSource h -> (h -> IO a) -> IO aSource
withSoundSourceRunning :: SoundSource h -> h -> IO a -> IO aSource
withSoundSink :: SoundSink h -> (h -> IO a) -> IO aSource
withSoundSinkRunning :: SoundSink h -> h -> IO a -> IO aSource
soundFmtMIME :: SoundFmt -> StringSource
audioBytesPerSample :: SoundFmt -> IntSource
audioBytesPerFrame :: SoundFmt -> IntSource
soundSourceBytesPerFrame :: SoundSource h -> IntSource
soundSinkBytesPerFrame :: SoundSink h -> IntSource
soundSourceReadBytes :: SoundSource h -> h -> Ptr () -> Int -> IO IntSource
soundSinkWriteBytes :: SoundSink h -> h -> Ptr () -> Int -> IO ()Source
copySoundSource
::
=> SoundSource h1
-> SoundSink h2
-> IntBuffer size (in bytes) to use
-> IO ()
alsaSoundSource :: String -> SoundFmt -> SoundSource PcmSource
alsaSoundSink :: String -> SoundFmt -> SoundSink PcmSource
fileSoundSource :: FilePath -> SoundFmt -> SoundSource HandleSource
fileSoundSink :: FilePath -> SoundFmt -> SoundSink HandleSource
Produced by Haddock version 2.4.2