Created
May 16, 2011 16:30
-
-
Save petermarks/974782 to your computer and use it in GitHub Desktop.
Pulse test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Sound.Pulse.Simple | |
main=do | |
s<-simpleNew Nothing "example" Play Nothing "this is an example application" | |
(SampleSpec (F32 LittleEndian) 44100 1) Nothing Nothing | |
simpleWrite s (take 44100 (test 440) ++ take 44100 (test 330) ) | |
simpleDrain s | |
simpleFree s | |
test :: Int -> [Float] | |
test f = cycle (replicate p 1.0 ++ replicate p (-1.0)) | |
where p = 22050 `div` f | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment