1.
CAF Convert to MP3 (yes)
Afconvert-f mp4f-d aac-b 128000/users/amarishuyi/desktop/sound1.caf/users/amarishuyi/desktop/sound1.mp3
http://blog.csdn.net/ysy441088327/article/details/7388351
2.lame
#include <stdio.h>#include<lame/lame.h>intMainvoid){ intread, write; FILE*PCM = fopen ("FILE.PCM","RB"); FILE*mp3 = fopen ("File.mp3","WB"); Const intPcm_size =8192; Const intMp3_size =8192; Short intpcm_buffer[pcm_size*2]; unsignedCharMp3_buffer[mp3_size]; lame_t lame=Lame_init (); Lame_set_in_samplerate (Lame,44100); LAME_SET_VBR (Lame, vbr_default); Lame_init_params (lame); Do{Read= Fread (Pcm_buffer,2*sizeof( Short int), pcm_size, PCM); if(Read = =0) Write=Lame_encode_flush (Lame, mp3_buffer, mp3_size); ElseWrite=lame_encode_buffer_interleaved (Lame, pcm_buffer, read, Mp3_buffer, mp3_size); Fwrite (Mp3_buffer, write,1, mp3); } while(Read! =0); Lame_close (lame); Fclose (mp3); Fclose (PCM); return 0;}
Http://stackoverflow.com/questions/2495420/is-there-any-lame-c-wraper-simplifier-working-on-linux-mac-and-win-from-pure
3rd month 15th Day Afconvert Lame