- data Speakers
- type SampleRate = Frequency
- standardSampleRates :: [SampleRate]
- type BlockSize = Int
- withSpeakers :: SampleRate -> BlockSize -> (Speakers -> IO a) -> IO a
- testSine :: Frequency -> IO ()
- type Sample = Float
- playSamples :: Speakers -> [Sample] -> IO ()
- type AudioBlock = Vector Sample
- playBlock :: Speakers -> AudioBlock -> IO ()
Very small module for playing audio data on your speakers.
Currently based on the Haskell OpenAL bindings.
Setting up audio devices
List of standard sample rates, from high quality to low quality
standardSampleRates = [44100,22050,11025]
Size of an audio block.
The lower the block size, the lower the latency. However, if the block size is too low, there will be jitter.
Recommended values: 64, 128, 256, 512
Initialize audio environment.
Play a test sine wave. Look at the source code to see how the library is used.
This should be a clear sound, similar to a telephone test tone. If there is rattling or hissing, you have a problem.
> testSine 440
Audio data and playback
Memory block containing audio data. Blockwise audio processing may be faster than lazy lists of samples.