Can audio being recorded be compressed on the fly?
or are there any libraries to take a .caf file, and convert to a compressed format?
Can audio being recorded be compressed on the fly?
or are there any libraries to take a .caf file, and convert to a compressed format?
The Core Audio APIs (which is what you'll be using to record audio) allow you to choose format, bitrate, etc. You can choose a low bitrate to keep the filesize down. In most cases with the iPhone, you're recording voice audio, and a low bitrate is fine.
The Audio Queue Services can record and encode audio. These are available on the iPhone. The documentation includes saving to a file of arbitrary format. I don't know if it's a perfect match for transcoding a .caf file but it's definitely worth a look.
The 2.x SDK does not have support for compressing audio.
You'll probably have to compile and link a 3rd party library.
Watch the CPU usage, it obviously won't be hardware
accelerated like the built-in decompression.