How to convert .wav to .flac? (Android platform)

Hello,

I wasted my past 14 hours trying to achieve this. I got so close but unfortunately failed. I already read the docs but couldn’t understand anything. Please help me. I’m out of ideas. I can’t think of anything else to try.

What I managed to do:
I found this: javaFlacEncoder - Browse Files at SourceForge.net

Converted the .jar file to .dll using IKVM. Then put it into Plugins/Android along with all DLLs of IKVM. Used this code in the C# script:

To the top:

 usingjavaFlacEncoder;

In a function:

FLAC_FileEncoder flacEncoder = new FLAC_FileEncoder();
java.io.File wavFile = new java.io.File(wavAudioFilePath);
java.io.File flacFile = new java.io.File(flacAudioFilePath);
flacEncoder.encode(wavFile, flacFile);

The first line gave this error:
DllNotfoundException: MonoPosixHelper

I still need a solution.