[plt-scheme] DrScheme and sound. Perhaps somebody did it.
On Thursday, October 16, 2003, at 08:53 AM, Eli Barzilay wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> On Oct 16, Jerzy Karczmarczuk wrote:
>>
>> 1. My problem is that it seems that the *only* way to play sound by
>> DrScheme is (play-sound wav_file). There is NO way to play an
>> array, like in Matlab, where sound(...) takes an array and the
>> sampling rate as parameters. It is exactly this, which bothers
>> me. I believe that a low-level interface *is* simple indeed, but
>> it is not there, so I asked whether anybody has some idea about.
>>
>> 2. In this context the speed is not so relevant, if you manage to
>> pump an entire unboxed sound vector into the device buffer, and
>> if the device administrates its events in parallel with
>> Scheme. The creation of sound patches might/would be slow, but
>> probably acceptable. Mind you, such experiments with low-level
>> sound producing were done on 6MHz 8-bit microprocessors...
>
> Both speed and memory consumption will be improved by the srfi/4
> stuff, and if the Windows API is as easy as that matlab thing, then
> you could probably write a very simple extension to play a
> homo-*-vector.
Actually, there's a (non-exp-tagged) collection named 'libsndfile' which
interacts with the publically available library of the same name to
read &
write sound files into srfi-4 arrays. Looks like it's all still
working.
There's nothing real-time about this stuff; when I was using it, I was
just writing
the stuff to disk and playing it with play-sound. Actually, though, it
was
quite responsive; reading & writing 3-minute sounds didn't take more
than 30
or 40 seconds, as I recall.
I'd be glad to bundle this collection up into a .plt file, if you like.
john