/////////////////////////////////////////////////////////////////////
// iOS - generate .caf from .wav (requires MacOS)
/////////////////////////////////////////////////////////////////////

afconvert -c 1 -f caff -d aac cure.wav

where;
-c means number of channels
-f means file format (caff is apple's container format)
-d means encoder (aac is great for music)

the output will be a new file, where afconverts picks the filename. Optionally you can specify -o to have your own output file name.

afconvert comes per default with MacOS

if you want to know how a file is encoded use this:
afinfo myfile.caff


/////////////////////////////////////////////////////////////////////
// Android - generate MP3 (requires ffmpeg)
/////////////////////////////////////////////////////////////////////
On MacOS you can install ffmpeg via brew, but it should also exist on other platforms.

# Caf to mp3 (note: going from compression to another compression - possibly not lossless)
ffmpeg -i vampire_music.caf -ac 1 vampire_music.mp3

# Wave to mp3
ffmpeg -i vampire_music.wav -ac 1 vampire_music.mp3

if you want to control quality (and filesize), try this:
ffmpeg -i vampire_music.wav -qscale:a 1.5 -ac 1 vampire_music.mp3


where;
- ac specifies number of channels.
-qscale:a 1.5 specify the quality. higher number = smaller file (try a 0.5 to 4 range)