[gambit-list] Troubles wrapping libao and libvorbisfile with C-interface
wwwwyyyynnnn at gmail.com
Wed May 20 14:41:51 EDT 2015
Passing around byte vectors you probably want to do as u8vector
scheme-object:s. I would guess right now you have a translation problem
between the C and Scheme world of your buffer data pointer, and maybe that
whole thing is messed up so it's surprising your program doesn't crash.
foreign-address is your friend also.
2015-05-20 23:53 GMT+05:30 Marshall Mason <marshallmason2 at gmail.com>:
> 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'"
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gambit-list