[gambit-list] Troubles wrapping libao and libvorbisfile with C-interface

Marshall Mason marshallmason2 at gmail.com
Wed May 20 14:23:22 EDT 2015

I'm new to Gambit, and to help me learn it, I'm trying to interface with
some C libraries, libao and libvorbisfile. It should play a simple Ogg
Vorbis sound file. It compiles and runs without error, but no sound is
played. I'm wondering if someone can help me with it. Here is the code:

I've narrowed the culprit to the named let toward the bottom, called
read-some. If, instead of this, I just implemented the whole loop in C, it
works. Here is the code that works:

Although this works, I'd like to understand why it doesn't work the first
way. My suspicion is that this has something to do with the character array
that holds the decoded buffer, called *pcmout*. I've tried using a
nonnull-char-string, but this created errors, so I created a
make-char-array function, to ensure that the string was the proper size.
The manual was unclear about how to do that.

Anyone want to take a stab at this? Here's the version of Gambit I'm using:

v4.7.4 20150228031125 x86_64-unknown-linux-gnu "./configure
'--enable-single-host' '--enable-c-opt' '--enable-gcc-opts'"

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150520/ce3c0200/attachment.htm>

More information about the Gambit-list mailing list