On Wed, Nov 18, 2009 at 9:20 PM, Balazs Komuves <[email protected]> wrote:
>
> Hi,
>
>> as a beginner I have a beginner's question: Which is the most simple way
>> to make my haskell programm play a sound?
>
> It really depends what kind of sound you want to make. Play a beep, or a
> .wav file,
> or a waveform generated by your program, or just play a piano-like sound,
> etc...?
>

Completely true, a little more context would be helpful here.

>
> Another crossplatform solution is PortAudio; I have no experience with it.
> http://hackage.haskell.org/package/portaudio

I have used PortAudio on Mac and it works well.  Should work on Linux
too, and most likely works on Windows.  It may be lower-level than
what you're looking for.

>
> If you want just to play back a .WAV sample on Windows, there is the
> PlaySound function in the Win32 API, which makes this trivial; it is
> very easy to call this using the Haskell FFI.
> http://msdn.microsoft.com/en-us/library/dd743680(VS.85).aspx
>
> There is the Sox library http://hackage.haskell.org/package/sox.
>

Sox is good on linux, but I don't know that I would consider it cross-platform.

>
>>
>> (I was hoping that there was a  Windows&Linux library with a simple
>> command to play a note for a given time or some other simple solution
>> for simple sound production).
>
> Unfortunately we are not there yet :)

If you want to play an audio file, then I would look at sox or portaudio.

If you want to do audio synthesis, then possibly Haskore-synthesizer
or YampaSynth may suit, but the impression I get is that they're
relatively linux-centric.

If you're looking to doing more complicated audio synthesis, then
either the supercollider or csound bindings may be a better choice.  I
know that csound is cross-platform and will handle audio output for
you, although compiling hCsound on windows can be tricky.

Cheers,
John
_______________________________________________
haskell-art mailing list
[email protected]
http://lists.lurk.org/mailman/listinfo/haskell-art

Reply via email to