Apparently fields of type Memory are not handled. The simple fix is to declare the field with type Pointer.
Example class that causes an error:
public class AudioBuffer extends Structure {
public int numberChannels;
public int dataByteSize;
public Memory data;
public AudioBuffer(int sz) {
data = new Memory(sz);
dataByteSize = sz;
}
}
Exception in thread "main" java.lang.IllegalArgumentException: Invalid
Structure field in class macaudio.AudioBufferList, field name
'buffers', class [Lmacaudio.AudioBuffer;: Invalid Structure field in
class macaudio.AudioBuffer, field name 'data', class
com.sun.jna.Memory: Type class com.sun.jna.Memory has unknown native
alignment
Apparently fields of type Memory are not handled. The simple fix is to declare the field with type Pointer.
Example class that causes an error:
Exception in thread "main" java.lang.IllegalArgumentException: Invalid
Structure field in class macaudio.AudioBufferList, field name
'buffers', class [Lmacaudio.AudioBuffer;: Invalid Structure field in
class macaudio.AudioBuffer, field name 'data', class
com.sun.jna.Memory: Type class com.sun.jna.Memory has unknown native
alignment