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

僤鯓⒐⒋嵵緔 提交于 2019-11-30 20:59:23

If you use the Audio Queue API for recording, instead of AVAudioRecorder, you will have access to raw PCM sample buffers, and can write those out to a flat file for later sending to your server.

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

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