Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sample rate for iPhone audio recording

What's the lowest optimal sample rate for audio recording on iPhone while still yielding good file size? Currently I am using 44.1kHz but it produces file that's way too big.

like image 598
Boon Avatar asked Oct 25 '09 22:10

Boon


2 Answers

On the iPhone with the built-in microphone, you're going to get a maximum of 8 kHz. If you use a headset, you can get 44.1 kHz. If you're using the built-in mic and setting your recording sample rate to 44.1 kHz, you're upsampling the audio, which is unnecessary and generates the big files you mention. Also, make sure you record in mono. That cuts the file size in half.

If you always want to record at the best rate, you should ask the hardware:

size = sizeof(sampleRate);
err = AudioSessionGetProperty (kAudioSessionProperty_CurrentHardwareSampleRate,
    &size, &sampleRate);

For voice, you can just always record at 8 kHz. For music, you want the best quality so use the sample rate that the hardware is running.

like image 96
lucius Avatar answered Oct 06 '22 09:10

lucius


It depends on what you mean by "optimal". 22.05kHz would still be good enough for most music. 11.025kHz would be more than adequate for recording speech. It all depends on what you're doing with the audio. I recommend using your ear to determine the best rate.

My other recommendation is for you to pick some answers for your questions. 44 is a great sampling rate, but an embarrassingly low acceptance rate.

like image 42
MusiGenesis Avatar answered Oct 06 '22 11:10

MusiGenesis