开发者

recorder works on iPhone 3GS but not on iPhone 3G

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:recordS开发者_如何转开发ettings  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


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

See this thread for supported formats: 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜