[fpc-pascal] Mac OSX API call
EarMaster - Bent Olsen
bent at earmaster.com
Fri Aug 29 12:20:10 CEST 2008
I've been playing with audio unit framework on Mac OSX 10.4, and trying to
make a sample from Xcode (PlayAudioFileLite) running on Lazarus 0.9.25/rev
15279 with FPC 2.2.0.
I'm nearly done, and I'm only getting an error -50 (error in user parameter
list) on the last API call from the callback process.
I don't have the sufficient experience with C/C++ vs. Pascal calling
conventions, but I've been lucky with other API calls, except for the last
one. I'm hoping one of you can help translate this call, which btw the way
works fine in Xcode - the sample is playing an audio file.
The API call is in the AudioFile.h:
AudioFileReadPackets ( AudioFileID inAudioFile,
I've translated this to:
function AudioFileReadPacket(inAudioFile: AudioFileID;
var outNumBytes: UInt32;
AudioStreamPacketDescription; //also tried Pointer
var ioNumPacket: UInt32;
var outBuffer: Pointer): OSStatus; external
name '_AudioFileReadPackets'; mwpascal;
I've tried to change the types of parameters in various combination, but yet
it didn't give me a clue on which of the parameters is in a wrong type.
I'm sorry if this off topic, but I'll be happy if one of you can tell me
what I'm translating wrong.
More information about the fpc-pascal