How can I record AMR audio format on the iPhone?

前端 未结 4 752
耶瑟儿~
耶瑟儿~ 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: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

提交回复
热议问题