iOS: Record audio in other format than caf

十年热恋 提交于 2019-12-07 20:45:06

问题


I am working on audio recording. I am able to record my audio in caf (Core audio format). Now I want to record sound in .mp3 or .amr.

I tried a lot of google but didn't found anything. I am not sure if my steps following work:

Write that Audio with .caf extention to document dir

Read data from that file

write the file again with .mp3 or .amr extention

I have 100% doubt that this will not going to work as this will just re save file with some other extension. This won't change audio codec.

I thought that for converting any format whether it is audio or video we need to change its codecs and data sequence.

Please also suggest me any player which don't play .caf files not anything else. So I can make sure that my files are converted successfully.

UPDATE Please also let me know that the way I am re-writing data with different extension is correct in the way I am needed?


回答1:


You might be interested in the iPhoneExtAudioFileConvertTest example.
The MP3 format is however not available due to patents, maybe you can use LAME.




回答2:


From the Document The Basics: Audio Codecs, Supported Audio Formats, and Audio Sessions



来源:https://stackoverflow.com/questions/11118836/ios-record-audio-in-other-format-than-caf

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