How can I record AMR audio format on the iPhone?

前提是你 提交于 2019-11-28 07:39:09
olegueret

AMR codec is NOT supported for encoding/recording on the iPhone, albeit it is supported for playback: this is the reason the kAudioFormatAMR constant exists.

Official api says that supported encoding formats are:

  • ALAC (Apple Lossless) ~> kAudioFormatAppleLossless
  • iLBC (internet Low Bitrate Codec, for speech) ~> kAudioFormatiLBC
  • IMA/ADPCM (IMA4) ~> kAudioFormatAppleIMA4
  • linear PCM ~> kAudioFormatLinearPCM
  • µ-law ~> kAudioFormatULaw
  • a-law ~> kAudioFormatALaw

You may try one of these formats or use an open source AMR encoder as goldenmean suggests.

edit: Updated Official api link

To update olegueret's link to the official documentation (why do they hide this stuff?)

http://developer.apple.com/library/ios/#qa/qa2008/qa1615.html

I guess AMR codec format is not supported my iPhone voice recorder app.

May be one can try integrating some open-source, implementation of AMR encoder into the apples' iPhone application framework and try making the voice recorder store the audio in AMR encoded format. (i dont know if thats allowed by apple by their NDA/license).

-AD

You can record audio to a uncompressed Linear PCM buffer (circular or ring), and, in another thread, convert data in this buffer, using your own AMR (or other) compression engine, before saving the compressed audio data to a file.

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