tags:

views:

555

answers:

3

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?

+1  A: 

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.

August
I'm already using a low bit rate. Just want to make file even smaller for upload.
Alan
+1  A: 

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.

Matt Gallagher
A: 

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.

Rhythmic Fistman