Objective-C Audio experiment

July 5, 2009 § Leave a comment

I couldn’t find any good information on Audio performance and quality. I am sharing my experiement here.

System Audio Services, declared in AudioToolbox/AudioServices.h only supports .caf, .aif, or .wav files. The audio data in the file must be in PCM or IMA/ADPCM (IMA4) format.  The file’s audio duration must be less than 30 seconds.

AVAudioPlayer supports .m4a, .mp3, .wav, .aif, and .caf.

Simulator is not a reliable tool to test and verify audio performance and quality.

  • AudioServicePlaySystemSound doesn’t play 128 bitrate 44,100 sampling rate wave, aif and caf audio files on simulator even it plays on device
  • Simulator won’t be able to reproduce the speaker sound
  • Simulator can’t tell the audio performance between AudioServicePlaySystemSound & AVAudioPlayer

Using the same .wav audio file, by default, AVAudioPlayer is much much louder than AudioServicePlaySystemSound on device. Both sound the same on simulator. I suspect iphone use different hardware mechanism to play AudioServicePlaySystemSound and AVAudioPlayer.

I don’t notice much differences in audio quality among audio formats in .wav, .aif, .caf, .mp3, .m4a in device & simulator. However for the same audio file, the file sizes are much smaller in m4a (44KB), and mp3 (96MB), compared to wav (1MB), AIF (1MB), and CAF (1MB). File sizes do not correspond to rendering time based on profiling on simulator.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

What’s this?

You are currently reading Objective-C Audio experiment at Web Builders.


%d bloggers like this: