Using the pulse-simple package I have made the following code:
main=do
s<-simpleNew Nothing "example" Record Nothing "this is an example application"
(SampleSpec (F32 LittleEndian) 44100 1) Nothing Nothing
xs<-simpleRead s $ 44100*10 :: IO [Float]
simpleFree s
play xs
play :: [Float] -> IO ()
play d = do
s<-simpleNew Nothing "example" Play Nothing "this is an example application"
(SampleSpec (F32 LittleEndian) 44100 1) Nothing Nothing
simpleWrite s d
simpleDrain s
simpleFree s
This works and records 10 seconds of audio and then plays it back.
I now want to encode and save the audio file (as a .wav rr whatever) so it can be played in another program or converted. I think that this is more of an audio question so for the non Haskell people I basically have an array of floats which is 44100*10 long. I suspect I'll need some other library.
Thanks in advance.