[plt-scheme] audio
On Fri, Jun 06, 2008 at 12:21:09PM -0700, John Clements wrote:
> On Jun 5, 2008, at 7:32 AM, Atmam Ta wrote:
>
> >Hi,
> >
> >I would like to play a sound file and be able to pause it in
> >response to a user event (or alternatively, play a short segment of
> >an audio file). Is this possible in PLT-Scheme? I have not found any
> >library for such tasks...
>
> I'm not aware of such a library. I'm guessing that the difficulty here
> is in supplying something cross-platform. It would probably be
> (relatively) simple, though, to use the FFI to construct a PLaneT
> package that works on one particular platform.
In the C world, I've had a lot of good milage from the
"portaudio" library, which is open source, quite high
performance, and cross-platform. That is, the library exposes a
common API across a variety of platforms that at least matches
those of PLT. So: that would seem to be a good starting point,
but the gotcha is that it fairly fundamentally relies on
host-platform threads and callbacks (the audio-IO happens in a
callback in a different thread from the main program). Not sure
how much of a problem that will be for FFI, because I've not
attempted to do any of that yet.
Might be worth investigating, anyway.
Cheers,
Andrew