How to convert a wav or caf audio file on iPhone

你。 提交于 2019-12-12 02:33:20

问题


I am working on a iPhone IM app, which support audio message. I've tried caf and wav format follow "Speak Here", but the files are too large to be send through the internet. So I'm wondering if I can convert any of them to some small format, like mp3 or amr.

Thank you for you help in advance.


回答1:


CoreAudio has som great built-in datatypes for just this Core Audio Data Types

Use iLBC, short for Internet Low Bitrate Codec, to record your audio. Limit your sample rate to 8kHz.

If you insist on mp3, use LAME - the open source MP3 encoder library to convert your audio.




回答2:


After you've recorded the audio file, the iOS AVFoundation AVAsset Reader/Writer APIs can be used to convert the file by, say, reading a .wav and writing AAC or other compressed file type.



来源:https://stackoverflow.com/questions/7763738/how-to-convert-a-wav-or-caf-audio-file-on-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!