【问题标题】:recorder works on iPhone 3GS but not on iPhone 3G录音机适用于 iPhone 3GS 但不适用于 iPhone 3G
【发布时间】:2011-03-31 09:50:05
【问题描述】:

我有一个 AVAudioRecorder,它的初始化如下:

_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];

此代码在我的模拟器和我的 iPhone 3GS 上完美运行,但在旧款 iPhone 3G 上却不行...

这有什么问题?

谢谢 马库斯

【问题讨论】:

    标签: iphone avaudiorecorder 3g iphone-3gs


    【解决方案1】:

    iPhone 3G 不支持硬件 AAC 编码,如 3GS/4/4S。你可以使用线性 PCM,但那不是压缩的。

    有关支持的格式,请参阅此线程:How can I record AMR audio format on the iPhone?

    Apple lossless (kAudioFormatAppleLossless) 和 iLBC (kAudioFormatiLBC) 似乎在 iPhone 3G 上运行良好。

    推荐使用kAudioFormatAppleIMA4,但手机Safari无法识别。

    /马库斯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-08
      • 1970-01-01
      相关资源
      最近更新 更多