1

使用 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 /版本/A/安全
预期在:/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 /版本/A/安全
预期在:/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 /版本/A/安全
预期在:/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'

4

2 回答 2

0

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

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

于 2015-02-15T11:30:20.877 回答
-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];
于 2014-06-26T08:47:04.850 回答