2

I've been using AVAudioRecorder to record audios on the iPhone, but the file is too large to upload to the server on an EDGE network. I found that If I could compress the audio to AMR format, the size would be dramatically reduced compared with the original PCM audio file.

I found an AMR encoding & decoding library (3GPP AMR Floating-point Speech Codec) written in pure C. I can convert WAVE to AMR using this library now, however, the encoding process is too long on the iPhone. I have to wait for 22 seconds to encode a 1 minute Wave file.

I really need to to record along with encoding to eliminate the encoding wait, but AVAudioRecorder only provides recording capability via creating new files. Seems the only way to do this is to use AudioQueue, which provides recording through memory buffer.

The problem is that I don't know how to integrate the two thing, the Audio Queue and the AMR library. Could anyone help me out?

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
nonamelive
  • 6,510
  • 8
  • 40
  • 47

1 Answers1

1

Core Audio has built-in support for 3GPP/AMR. Use ExtAudioFile or the lower-level AudioConverter.

Peter Hosey
  • 95,783
  • 15
  • 211
  • 370