Discussion:
[haskell-art] Library for simple playing of sounds?
Iavor Diatchki
2012-10-10 16:33:32 UTC
Permalink
Hello,

is there an existing Haskell library that makes it easy to play and mix
audio samples in a portable way? (with emphasis on easy and portable :-)

I've made a binding to portaudio, which works but---as far as I
understand---in order to get overlapping samples to play, I have to mix the
samples myself, which I can do, but I thought I'd check if there might be
an already existing solution so I don't have to mess with these low-level
details.

The context is that I thought that it'd be fun to add sound effects to a
small game that I wrote with some friends, so the samples will be
pre-recorded .wav files (probably quite short) but they may overlap, which
is why I need the mixing.

Ideas?

-Iavor
Henning Thielemann
2012-10-10 16:43:22 UTC
Permalink
is there an existing Haskell library that makes it easy to play and mix audio samples in a portable way?
(with emphasis on easy and portable :-)
At the first glance I wondered why _you_ ask this question, because you
have written the ALSA bindings that I maintain. :-)

Easy and portable is certainly a problem. You may try the 'sox' library
which calls the 'play' command. However this requires that the 'sox'
package is installed. It is certainly also possible to add the
functionality to the soxlib bindings.

http://hackage.haskell.org/package/sox
http://hackage.haskell.org/package/soxlib

http://hackage.haskell.org/packages/archive/sox/0.2.2.2/doc/html/Sound-Sox-Play.html
Tristan Matthews
2012-10-10 17:09:07 UTC
Permalink
Post by Iavor Diatchki
is there an existing Haskell library that makes it easy to play and mix
audio samples in a portable way?
(with emphasis on easy and portable :-)
Possibly SDL mixer (although I haven't used it personally):
http://hackage.haskell.org/package/SDL-mixer-0.6.1
At the first glance I wondered why _you_ ask this question, because you have
written the ALSA bindings that I maintain. :-)
Easy and portable is certainly a problem. You may try the 'sox' library
which calls the 'play' command. However this requires that the 'sox' package
is installed. It is certainly also possible to add the functionality to the
soxlib bindings.
http://hackage.haskell.org/package/sox
http://hackage.haskell.org/package/soxlib
http://hackage.haskell.org/packages/archive/sox/0.2.2.2/doc/html/Sound-Sox-Play.html
_______________________________________________
haskell-art mailing list
http://lists.lurk.org/mailman/listinfo/haskell-art
--
Tristan Matthews
web: http://tristanswork.blogspot.com
Stephen Sinclair
2012-10-10 22:35:57 UTC
Permalink
It looks like Hackage also has OpenAL bindings:

http://hackage.haskell.org/package/OpenAL

On Wed, Oct 10, 2012 at 1:09 PM, Tristan Matthews
Post by Tristan Matthews
Post by Iavor Diatchki
is there an existing Haskell library that makes it easy to play and mix
audio samples in a portable way?
(with emphasis on easy and portable :-)
http://hackage.haskell.org/package/SDL-mixer-0.6.1
At the first glance I wondered why _you_ ask this question, because you have
written the ALSA bindings that I maintain. :-)
Easy and portable is certainly a problem. You may try the 'sox' library
which calls the 'play' command. However this requires that the 'sox' package
is installed. It is certainly also possible to add the functionality to the
soxlib bindings.
http://hackage.haskell.org/package/sox
http://hackage.haskell.org/package/soxlib
http://hackage.haskell.org/packages/archive/sox/0.2.2.2/doc/html/Sound-Sox-Play.html
_______________________________________________
haskell-art mailing list
http://lists.lurk.org/mailman/listinfo/haskell-art
--
Tristan Matthews
web: http://tristanswork.blogspot.com
_______________________________________________
haskell-art mailing list
http://lists.lurk.org/mailman/listinfo/haskell-art
Continue reading on narkive:
Loading...