public
Last active

Pulse test

  • Download Gist
gistfile1.hs
Haskell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.