How can I Access/extract raw(headless) audio data from a caf file on iPhone?

前端 未结 2 397
孤独总比滥情好
孤独总比滥情好 2021-01-05 16:19

I am working on a project that requires me to send raw headerless ulaw or linear pcm data to a server.

I am using the AVAudioRecorder and I can save out audio files

2条回答
  •  醉梦人生
    2021-01-05 17:03

    If the audio data in the CAF is already in the format you need it in, I'd use the AudioFile API to grab the caf file's audio data and write them to a headerless/RAW file before uploading to my server.

    If you need to convert the CAF's data, use the ExtAudioFile API instead. Either way, pretty straightforward.

    http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/AudioFileConvertRef/Reference/reference.html

    http://developer.apple.com/library/ios/#documentation/MusicAudio/Reference/ExtendedAudioFileServicesReference/Reference/reference.html

提交回复
热议问题