Safe Haskell | None |
---|---|
Language | Haskell98 |
Play audio signals via ALSA.
The module could also be called Output
,
because with a file
sink, data can also be written to disk.
Synopsis
- type Device = String
- defaultDevice :: Device
- defaultChunkSize :: ChunkSize
- makeSink :: (SampleFmt y, C t) => Device -> t -> SampleFreq -> SoundSink Pcm y
- write :: Storable y => SoundSink handle y -> handle y -> Vector y -> IO ()
- writeLazy :: Storable y => SoundSink handle y -> handle y -> Vector y -> IO ()
- auto :: SampleFmt y => SoundSink handle y -> T y -> IO ()
- autoAndRecord :: (SampleFmt y, C y) => FilePath -> SoundFmt y -> SoundSink handle y -> T y -> IO ExitCode
- autoAndRecordMany :: (SampleFmt y, C y, Traversable f) => f FilePath -> SoundFmt y -> SoundSink handle y -> T y -> IO (f ExitCode)
- monoToInt16 :: (Storable y, C y) => SoundSink handle Int16 -> T y -> IO ()
- stereoToInt16 :: (Storable y, C y) => SoundSink handle (T Int16) -> T (T y) -> IO ()
auxiliary functions
defaultChunkSize :: ChunkSize Source #
A suggested default chunk size. It is not used by the functions in this module.
:: (SampleFmt y, C t) | |
=> Device | ALSA output device |
-> t | period (buffer) size expressed in seconds |
-> SampleFreq | sample rate |
-> SoundSink Pcm y |
Useful values for the output device are
"default"
for mixing with the output of other applications."plughw:0,0"
for accessing sound output in an exclusive way."tee:default,'output.raw',raw"
for playing and simultaneously writing raw data to disk."tee:default,'output.wav',wav"
for playing and writing to WAVE file format. Note that the length cannot be written, when the program is terminated, leaving the file in an invalid format.
play functions
autoAndRecord :: (SampleFmt y, C y) => FilePath -> SoundFmt y -> SoundSink handle y -> T y -> IO ExitCode Source #
Play a signal and write it to disk via SoX simultaneously.
Consider using auto
with tee
device.