Record audio on the smallest file size iPhone

I want to record audio from an iPhone and then upload it to a server.

I could record audio, but my question is what format should I use to record audio, so that the Recorder will result in the file with the smallest file size.

+4
source share
3 answers

Below are the results for several encodings supported by iPhone. The size of the audio file in KB is 10 seconds long.

kAudioFormatMPEG4AAC: 164 ,

kAudioFormatAppleLossless: 430,

kAudioFormatAppleIMA4: 475,

kAudioFormatULaw: 889,

kAudioFormatALaw: 889,

Among these, kAudioFormatMPEG4AAC has the smallest size.

+9
source

Apple iOS supports audio playback in the following formats:

  • AAC (Advanced MPEG-4 Encoding)
  • ALAC (Apple Lossless)
  • HE-AAC (MPEG-4 High Performance AAC)
  • iLBC (Internet codec with a low bit rate, another format for speech)
  • IMA4 (IMA / ADPCM)
  • Linear PCM (Uncompressed, Linear Pulse Code Modulation)
  • MP3 (MPEG-1 3 audio layer)
  • ΞΌ-law and a-law

The following formats are possible for recording:

  • AAC (Advanced MPEG-4 Encoding)
  • ALAC (Apple Lossless)
  • iLBC (Low Bitrate Internet Codec, for Speech)
  • IMA4 (IMA / ADPCM)
  • Linear PCM (Uncompressed, Linear Pulse Code Modulation)
  • ΞΌ-law and a-law

while only AAC supports hardware encoding (see Apple iOS SDK documentation )

For versatility in accessibility, I prefer MP3.

Check out these links to find the exact code for recording sound - Record Sound on iPad with AVAudioRecorder

+3
source

It depends on the type of sound you record and the quality of sound you want.

If, for example, you record voice with a built-in microphone, iLBC will provide you with the smallest sound file (15.2 kbps for 20 ms frames, 13.33 kbps for 30 ms frames).

0
source

All Articles