views:

36

answers:

1

Hi everybody,

I have a AVAudioRecorder, which gets initialized like:

_recorder = [AVAudioRecorder alloc];
NSMutableDictionary *recordSettings = [[[NSMutableDictionary alloc] initWithCapacity:2] autorelease];
[recordSettings setObject:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey: AVFormatIDKey];
[recordSettings setObject:[NSNumber numberWithInt:AVAudioQualityLow] forKey: AVEncoderAudioQualityKey]; 
NSURL *url = [NSURL fileURLWithPath:[self getActualSoundPath]];
[_recorder initWithURL:url settings:recordSettings  error:nil];    
[_recorder setDelegate:self];

This code works perfectly in my Simulator and on my iPhone 3GS but not on the older iPhone 3G...

What is the problem on that?

Thanks Markus

+1  A: 

The iPhone 3g doesnt have support for hardware AAC encoding like the 3GS/4. You could use linear PCM, but thats not compressed.

See this thread for supported formats: http://stackoverflow.com/questions/276644/how-can-i-record-amr-audio-format-on-the-iphone

Apple lossless (kAudioFormatAppleLossless) and iLBC (kAudioFormatiLBC) seems to work fine on the iPhone 3G.

kAudioFormatAppleIMA4 is recommended to use, but its not recognized by mobile Safari.

/Marcus

Marcus