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

时间:2012-09-15 16:57:45

标签: 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/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 MySpellings [538:4907] aq @ 0xea13200:   ConvertInput:AudioConverterFillComplexBuffer返回560226676,   packetCount 21 2012-09-15 17:51:42.254 MySpellings [538:c07]潮红   待处理输入终止 - 错误'!dat'

2 个答案:

答案 0 :(得分:0)

在我的情况下,显示错误是因为我使用了错误的比特率:

我忘记了我使用了Kbps而AVEncoderBitRateKey使用了bps。 因此,在我将比特率乘以1000后,错误就消失了。

答案 1 :(得分:-1)

当录制为m4a格式(AVFormatIDKey = kAudioFormatMPEG4AAC)时,我在模拟器中录制音频也遇到了问题。没有录制音频,控制台日志包含" 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];