【问题标题】:Sound Output Meaning声音输出含义
【发布时间】:2012-06-23 06:10:55
【问题描述】:

所以我在按下时在我的UIButton 中添加了一个声音 (.wav),但它在调试器中输出了这个,任何人都可以解释或帮助我这是什么:

2012-06-21 10:29:51.784 PhotoSlot[817:1dc0b] The default input device's sample rate was changed.
2012-06-21 10:29:51.786 PhotoSlot[817:21a2b] Audio device's sample rate changed. You may need to restart the simulator.
2012-06-21 10:29:51.786 PhotoSlot[817:1dd0f] Default audio device changed. Restart the simulator to have it use the newly-selected device.

这是我的声音代码:

NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
resourcePath = [resourcePath stringByAppendingString:@"/push.wav"];
    //Initialize our player pointing to the path to our resource
player = [[AVAudioPlayer alloc] initWithContentsOfURL:
          [NSURL fileURLWithPath:resourcePath] error:NULL];
//set our delegate and begin playback
player.delegate = self;
[player play];

谢谢。

2012-06-21 11:24:09.702 PhotoSlot[1578:1a303] 加载错误 /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262):未找到符号:__CFObjCIsCollectable 引用自: /System/Library/Frameworks/Security.framework/Versions/A/Security
预计在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:09.711 PhotoSlot [1578:1a303] 加载错误 /System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn: dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn, 262):未找到符号:_
_CFObjCIsCollectable 引用自: /System/Library/Frameworks/Security.framework/Versions/A/Security
预计在: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:09.996 PhotoSlot [1578:1a303] 加载错误 /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.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10.006 PhotoSlot [1578:1a303] 加载错误 /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.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10.024 PhotoSlot [1578:1a303] 加载错误 /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.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10.033 PhotoSlot [1578:1a303] 加载错误 /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.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10.053 PhotoSlot [1578:1a303] 加载错误 /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.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation 在 /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10.071 PhotoSlot [1578:1a303] 加载错误 /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.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

【问题讨论】:

  • 查看“AVAudioPlayer”实例化中的“error”参数是否返回 NULL 以外的值可能很有用。另外,当你完成播放器时,你是把它设置为 nil(如果使用 ARC)还是释放它(如果不使用 ARC)?
  • 不,我没有将我的播放器设置为 nil,会不会有问题?

标签: iphone ios xcode


【解决方案1】:

啊,发布错误对我有帮助。 I found this closely related question 也具有与您所看到的相同的输出。

但我认为您应该采取的真正解决方案(假设您使用 ARC)is found in this other answer:您需要在播放声音时为您的“AVAudioPlayer”实例保留一个强有力的参考。将您的播放器设为“strong”ivar(实例变量),然后在播放新声音之前设置“self.player = nil;”,这应该可以解决您的问题。

另外,关闭模拟器调试器中的所有断点,看看你是否有更好的运气。

【讨论】:

  • 谢谢你,很好,但是我按下按钮后加载速度有点慢。
  • "很好" = 你的问题解决了吗?如果按下按钮后加载有点慢,是不是声音文件很大?
  • 我的.wav只有8Kb,但是我在我的按钮中应用了一个核心动画,是不是因为动画,因为我的动画是连续闪烁的,
  • 可能是!不过,我很高兴您的声音问题似乎得到了解决。
  • 仍然显示错误,但我已阅读您发布的链接,说它是安全的。谢谢。
猜你喜欢
  • 1970-01-01
  • 2014-07-09
  • 1970-01-01
  • 1970-01-01
  • 2018-02-25
  • 2012-06-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多