在iPhone模拟器中录制音频时出错

在iPhone模拟器中录制音频时出错,iphone,ios,ios-simulator,Iphone,Ios,Ios Simulator,在使用AVFoundation在iPhone模拟器中录制音频时,我遇到以下错误。我的代码在设备上运行良好 有什么想法吗?提前谢谢 2012-09-15 17:51:39.592 MySpellings[538:3503]加载错误 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen/System/Libr

在使用AVFoundation在iPhone模拟器中录制音频时,我遇到以下错误。我的代码在设备上运行良好

有什么想法吗?提前谢谢

2012-09-15 17:51:39.592 MySpellings[538:3503]加载错误 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262:找不到符号:_CFObjCIsCollectable引用自: /System/Library/Frameworks/Security.framework/Versions/A/Security 预计在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在/System/Library/Frameworks/Security.framework/Versions/A/Security中 2012-09-15 17:51:39.598 MySpellings[538:3503]加载错误 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262:找不到符号:_CFObjCIsCollectable引用自: /System/Library/Frameworks/Security.framework/Versions/A/Security 预计在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在/System/Library/Frameworks/Security.framework/Versions/A/Security中 2012-09-15 17:51:39.607 MySpellings[538:3503]加载错误 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262:找不到符号:_CFObjCIsCollectable引用自: /System/Library/Frameworks/Security.framework/Versions/A/Security 预计在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在/System/Library/Frameworks/Security.framework/Versions/A/Security中 2012-09-15 17:51:39.612 MySpellings[538:3503]加载错误 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262:找不到符号:_CFObjCIsCollectable引用自: /System/Library/Frameworks/Security.framework/Versions/A/Security 预计在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在/System/Library/Frameworks/Security.framework/Versions/A/Security中 2012-09-15 17:51:40.932我的拼写[538:4907]aq@0xea13200: ConvertInput:AudioConverterFillComplexBuffer返回560226676, packetcount212012-09-1517:51:42.254我的拼写[538:c07]刷新 挂起的输入已终止-错误'!dat'


当录制到m4a格式AVFormatIDKey=KAUDIOOFORMATMPEG4AAC时,我在模拟器中录制音频时也遇到问题。控制台日志中包含AudioConverterFillComplexBuffer的错误,未记录任何音频

但是,录制为.caf格式的kAudioFormatAppleIMA4确实有效,对于某些人来说,这可能是一个解决方案

recordSettings = [NSDictionary
                  dictionaryWithObjectsAndKeys:
                  [NSNumber numberWithInt:AVAudioQualityMin],
                  AVEncoderAudioQualityKey,
                  [NSNumber numberWithInt:16],
                  AVEncoderBitRateKey,
                  [NSNumber numberWithInt: 1],
                  AVNumberOfChannelsKey,
                  [NSNumber numberWithFloat:16000.0],
                  AVSampleRateKey,
                  [NSNumber numberWithInt: kAudioFormatAppleIMA4],
                  AVFormatIDKey,
                  nil];

在我的例子中,显示该错误是因为我使用了错误的比特率:

我忘了我用的是Kbps,AvencoderBitatekey用的是bps。
因此,在我将比特率乘以1000后,错误消失。

可能会在副本上复制“不确定”,我的应用程序不会崩溃,并显示不同的错误。这只是一个模拟器问题。不用担心…反正要修好它?我想将我的设备移动到iOS 6,并使用模拟器来测试iOS 5兼容性。这是因为从前面的消息中可以清楚地看到,有些人很难在模拟器上录制音频。