2012-06-21 150 views
2

所以我在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從參考: /系統/庫/框架/ Security.framework/Versions/A/Security
預計於: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/L ibrary /在/System/Library/Frameworks/Security.framework/Versions/A/Security 框架/ CoreFoundation.framework /的CoreFoundation 2012-06-21 11:24:09.711 PhotoSlot [1578:1A303]錯誤加載 /系統/ 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 /開發商/軟件開發工具包/ iPhoneSimulator5 .0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /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 /內容/ MacOS的/ AppleHDAHALPlugIn, 262):符號未找到:__ CFObjCIsCollectable從參考: /System/Library/Frameworks/Security.framework/Versions/A/Security
預期在: /Applications/Xcode.app /Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSi mulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10.006 PhotoSlot [1578: 1a303] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn。包/內容/ MacOS的/ AppleHDAHALPlugIn, 262):找不到符號: /System/Library/Frameworks/Security.framework/Versions/A/Security
預期: /應用/的Xcode _
_CFObjCIsCollectable從引用。應用/內容/開發/平臺/ iPhoneSimulator.platform /開發商/ SD Ks/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-06-21 11:24:10。024 PhotoSlot [1578:1a303] Error loading /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 in /System/Library/Frameworks/Security.framework /版本/ A /安全性 2012-06-21 1 1:24:10.033 PhotoSlot [1578:1a303] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn: dlopen(/ System/Library/Extensions/AppleHDA .kext /內容/插件/ AppleHDAHALPlugIn.bundle /內容/ 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 in/System/Library/Frameworks /Security.framework/Versions/A/Security 2 012-06-21 11:24:10.053 PhotoSlot [1578:1a303] Error loading /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 /安全
預計在:在 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation /系統/庫/框架/ Security.framework /版本/ A /安全 2012-06-21 11:24:10.071 PhotoSlot [1578:1a303] Error loading /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 /安全
預計於: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation

+0

它*可能會很有用,看你的AVAudioPlayer實例中的錯誤參數是否返回NULL以外的任何值。另外,當你完成遊戲後,你是否將玩家設置爲零(如果使用ARC)或釋放它(如果不使用ARC)? –

+0

不,我沒有把我的球員設置爲零,這可能是一個問題嗎? – Bazinga

+0

我發佈了錯誤, – Bazinga

回答

3

啊,發佈錯誤幫助我。 I found this closely related question,它也具有與您所看到的相同的輸出。

但我認爲你應該做的真正的解決方案(假設你使用ARC),is found in this other answer:你需要保持你的「AVAudioPlayer」實例很強的參考,而周圍的聲音播放。使您的播放器成爲「strong」ivar(實例變量),並在播放新聲音之前,設置「self.player = nil;」,並且應該解決您的問題。

另外,關閉模擬器調試器中的所有斷點,看看你是否有更好的運氣。

+0

Thankyou,這很好,但按下我的按鈕後,它有點慢。 – Bazinga

+0

「這很好」=你解決了你的問題?如果在按下按鈕後加載的速度很慢,您是否擁有大量聲音文件或什麼? –

+0

我的.wav只有8Kb,但是我在我的按鈕中應用了核心動畫,是因爲動畫,因爲我的動畫連續閃爍,可能是 – Bazinga