在iPhone模拟器中使用AVFoundation录制音频时,我会得到以下错误。我的代码在设备上正常工作。
有什么想法吗?提前谢谢。
2012-09-15 17:51:39.592 MySpellings538 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 in: /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-09-15 17:51:39.598 MySpellings538 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):找不到符号:引用: /System/Library/Frameworks/Security.framework/Versions/A/Security的___CFObjCIsCollectable 预期在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-09-15 17:51:39.607 MySpellings538 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):找不到符号:引用: /System/Library/Frameworks/Security.framework/Versions/A/Security的__CFObjCIsCollectable /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in: /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-09-15 17:51:39.612 MySpellings538 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):找不到符号:引用: /System/Library/Frameworks/Security.framework/Versions/A/Security的___CFObjCIsCollectable 预期在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-09-15 17:51:40.932 MySpellings538 538:4907 aq@0xea13200: ConvertInput: AudioConverterFillComplexBuffer返回560226676,packetCount 21 2012-09-15 17:51:42.254 MySpellings538 538:C07等待输入终止刷新-错误!
发布于 2015-02-15 11:30:20
在我的例子中,显示错误是因为我使用了错误的比特率:
我忘了我使用了Kbps,而AVEncoderBitRateKey使用了bps。所以,在我将比特率乘以1000之后,错误就消失了。
发布于 2014-06-26 08:47:04
在将音频录制为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];https://stackoverflow.com/questions/12439333
复制相似问题