IOS Audio format conversion--CAF turn mp3

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.