Android pcm file conversion to mp3

I was looking for a solution how to convert raw audio file, generated on Android, to mp3.
I did found a solution for it somewhere in Internet (unfortunately, lost the link).

-r – input is raw pcm
-m (j)oint, (s)imple, (f)orce, (d)dual-mono, (m)ono
default is (j) or (s) depending on bitrate
joint = joins the best possible of MS and LR stereo
simple = force LR stereo on all frames
force = force MS stereo on all frames.
-s sfreq sampling frequency of input file (kHz) – default 44.1 kHz
-x force byte-swapping of input

Note: I needed to adjust frequency of input file. The best value for me was 11. This might differ for your audio files.