[Haskell-cafe] Haskell audio libraries & audio formats

Eric Kidd haskell at randomhacks.net
Sun Aug 24 13:06:40 EDT 2008


On Sun, Aug 24, 2008 at 12:41 PM, John Van Enk <vanenkj at gmail.com> wrote:
> It implements the Haskell bindings to the PortAudio library. This is the
> library behind Audacious. I *have not* implemented the callback model yet,
> but I plan to do that.
>
> Perhaps this will be something which is useful to you?

Looks like a great binding! We actually use portaudio in callback mode
at work, with reasonable success (from C++).

One question: I notice that your writeStream function represents audio
using '[[a]]'.

  writeStream :: (Storable a) => PaStream a -- ^ The output stream
              -> [[a]]                    -- ^ The samples to be played
              -> Int                      -- ^ Number of frames
              -> IO (Either String ErrorCode) -- ^ The return status
of the write

In my experiments, I've been somewhat unsatisfied with the performance
of '[[a]]' as an audio format. Would you be interested in also
supporting an array-based format for audio data?

I'm currently converting my program to use HCodec's Data.Audio
representation, which looks pretty promising. I don't know how it
performs yet, but I'll let you know.

Thank you for the pointer to your library! It will make an excellent
addition to the available Haskell sound libraries.

Cheers,
Eric


More information about the Haskell-Cafe mailing list