Capturing audio input from a microphone using Haskell?

Is there a mature library that can include audio input and output and work in Haskell? (Of course, a good wrapper is fine.)

I am looking for something that can easily capture the microphone input and possibly play various audio files.

Thanks.

+6
io haskell audio
source share
4 answers

Easily capture microphone input and possibly play various audio files.

This will greatly depend on your OS platform: each OS has standard C libraries, and you will look for Haskell bindings to them (e.g. PulseAudio, etc.). Look in the "Sound" category in "Hackage":

eg. HSndFile for recording audio files, http://hackage.haskell.org/package/HSoundFile

+4
source share

the pulse-simple module provides bindings for recording sound from a microphone, see the second example at the top of the page;
https://hackage.haskell.org/package/pulse-simple-0.1.13/docs/Sound-Pulse-Simple.html
The pulsed audio libraries needed to use cabal can be obtained through cygwin (search for β€œmomentum” in the cygwin installer).

there is also a binding to sox, which looks promising. https://hackage.haskell.org/package/sox

im sure other api wrappers can be found in the category of hacker sounds.

for linux there is a binding to jack, has "unix" as a dependency, it is NOT built on windows ...

+3
source share

Just in case, you are not familiar with the hack: http://hackage.haskell.org/packages/archive/pkg-list.html

Looks like there are some audio related things there. Not sure if there is something that will satisfy your needs. But most haskell mature libraries will be there.

+1
source share

You can do this with OpenAL and ALUT . I managed to install both on Windows 8, although it was not quite easy; ALUT requires the C base library to be manually compiled into a DLL.

Installing OpenAL - on the other hand - is as simple as downloading the SDK and entering cabal install OpenAL at the command line.

Using ALUT, you can create OpenAL buffers from audio files (including WAV) and types of memory.

I found an example of recording and playing sound here . It should be pretty simple to adapt the code to your needs.

Let me know if I left something, and I will try to clarify.

+1
source share

All Articles