How can I get / extract raw (no sound) audio data from the caf file on the iPhone?

I am working on a project that requires me to send raw data to the server without header or linear pcm data.

I use AVAudioRecorder, and I can easily save audio files on the phone, but the problem is that no matter what I do and do, they are wrapped in a caf file or marked with some kind of header.

I understand that the caf file is just a wrapper file for raw audio data and that this audio data can be in various formats, including linear pcm and ulaw.

So my questions are: how can I generate a raw sound file without a caf shell to start with it (i.e. just alkaline raw sound added to the file), or if I record a caf that contains raw Ulaw sound or linear pcm audio data, how can I easily enter and extract only raw audio data from the caf file and leave everything else.

+5
source share
2 answers

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

+1
source

All Articles