How can I record AMR audio format on the iPhone?

前端 未结 4 723
耶瑟儿~
耶瑟儿~ 2020-12-09 05:08

A voice recorder doesn\'t need uncompressed Linear PCM audio. Compressed AMR would do fine. The iPhone framework built for recording audio is simple enough, b

相关标签:
4条回答
  • 2020-12-09 05:49

    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

    0 讨论(0)
  • 2020-12-09 05:49

    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.

    0 讨论(0)
  • 2020-12-09 05:57

    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

    0 讨论(0)
  • 2020-12-09 06:00

    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

    0 讨论(0)
提交回复
热议问题