Skip to content

Instantly share code, notes, and snippets.

@petermarks
Created May 16, 2011 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petermarks/974782 to your computer and use it in GitHub Desktop.
Save petermarks/974782 to your computer and use it in GitHub Desktop.
Pulse test
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