Generally in order to achieve the IPhone and Android to achieve audio interoperability. Then the MP3 format of the audio file is a good choice, of course, in addition to AMR is a best choice; AMR audio file 10 seconds about 5 K size.
We use a third-party framework--lame to convert CAF,PCM into MP3 format.
Okay, no more talking, now get to the chase.
What about before the conversion? You need to record the audio file first, before using Avaudiorecorder for audio recording, the following parameters are set:
Note that if the use of Weburl can not be used avaudioplayer only use Avplayer this point please note
The above parameters are necessary to convert to MP3 format, otherwise it will affect the quality of the converted Audio
When we're done with this, we import the lame static library.
Add lame header file to the file after adding lame static library
Here is the core of the transformation
Finally, because the conversion audio format is time-consuming, wait longer, so you can open a thread to perform the conversion of audio code
The basic conversion audio format is complete.
IOS Audio format conversion--CAF turn mp3