I'm interfacing with speex.
Here are my signatures in C (from speex.h)
__declspec(dllexport) void* speex_encoder_init_nb();
__declspec(dllexport) void speex_encoder_destroy(void *state);
According to the api in speex in C, i shall get the void* from the init, and use
it (blah blah blah), when doing the clean up, put this void* back to destroy()
now here is my java version
public interface LibSpeex extends StdCallLibrary {
public static final LibSpeex instance =
(LibSpeex )Native.loadLibrary("libspeex", LibSpeex.class);
Pointer speex_encoder_init_nb();
void speex_encoder_destroy(Pointer state);
}
Access violation occurs when i call destroy in this case. I tried to change the
parameter of destroy method from Pointer to PointerByReference but to no avail.
FYI, the code works without access violation when executed in c (i.e. when the
function was called in C if the program is in C)
Did i map the datatype wrongly?
Million thanks on the help.
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx