I faced a problem, that I can't solved for 3 days and you're my last hope.
My goal is to record sound with Bass.dll (there's special version of library for iPhone and version of .net wrapper for it; can be found here: un4seen.com)
On simulator program works (or seems to work properly). But when I tried to run it on the iPhone - I got this error:
"Attempting to JIT compile method '(wrapper native-to-managed) RecordingAudioHelloWorld.Player:recordingHandler (int,intptr,int,intptr)' while running with --aot-only."
error happens here:
RECORDPROC _recordingHandler = new RECORDPROC(recordingHandler);
_record = Bass.BASS_RecordStart(16000, 1, BASSFlag.BASS_SPEAKER_RIGHT, _recordingHandler, IntPtr.Zero); // <-- ERROR!!!
private int recordingHandler (int handle, IntPtr buffer, int length, IntPtr user)
{
//....
}
As I read here, on SO, I changed Linker behavior to "Link SDK assemblies only", but it has no effect.
Is there anything that I could do with it?
Try to add the MonoPInvokeCallback attribute to your recordingHandler function. Note that you also need to make the function static. YourDelegateType
should be the delegate type you defined in C# that corresponds to the signature of this method.
[MonoPInvokeCallback (typeof(YourDelegateType)]
private static int recordingHandler (int handle, IntPtr buffer, int length, IntPtr user)
{
// ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With