iphone - 声音输出含义
<p><p>所以我在按下时在我的 <code>UIButton</code> 中添加了一个声音 (.wav),但它在调试器中输出了这个,任何人都可以解释或帮助我这是什么:</p>
<pre><code>2012-06-21 10:29:51.784 PhotoSlot The default input device's sample rate was changed.
2012-06-21 10:29:51.786 PhotoSlot Audio device's sample rate changed. You may need to restart the simulator.
2012-06-21 10:29:51.786 PhotoSlot Default audio device changed. Restart the simulator to have it use the newly-selected device.
</code></pre>
<p>这是我的声音代码:</p>
<pre><code>NSString* resourcePath = [ resourcePath];
resourcePath = ;
//Initialize our player pointing to the path to our resource
player = [ initWithContentsOfURL:
error:NULL];
//set our delegate and begin playback
player.delegate = self;
;
</code></pre>
<p>谢谢。</p>
<blockquote>
<p>2012-06-21 11:24:09.702 PhotoSlot Error loading
/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): Symbol not found: __<em>CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:09.711 PhotoSlot Error loading
/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): Symbol not found: _</em>_CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:09.996 PhotoSlot 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): Symbol not found: __<em>CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:10.006 PhotoSlot 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): Symbol not found: _</em>_CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:10.024 PhotoSlot 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): Symbol not found: __<em>CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:10.033 PhotoSlot 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): Symbol not found: _</em>_CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:10.053 PhotoSlot 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): Symbol not found: __<em>CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/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
2012-06-21 11:24:10.071 PhotoSlot 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): Symbol not found: _</em>_CFObjCIsCollectable Referenced from:
/System/Library/Frameworks/Security.framework/Versions/A/Security<br/>
Expected in:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation</p>
</blockquote></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>啊,发布错误对我有帮助。 <a href="https://stackoverflow.com/questions/7961840/what-does-this-gdb-output-mean" rel="noreferrer noopener nofollow">I found this closely related question</a>它也具有与您所看到的相同的输出。</p>
<p>但我认为您应该采用的真正解决方案(假设您使用 ARC)<a href="https://stackoverflow.com/a/7744831/981049" rel="noreferrer noopener nofollow">is found in this other answer</a> :您需要在播放声音时为您的“<code>AVAudioPlayer</code>”实例保留一个强大的引用。让您的播放器成为“<code>strong</code>”ivar(实例变量),在播放新声音之前,设置“<code>self.player = nil;</code>”,这应该可以解决您的问题。</p>
<p>另外,关闭模拟器调试器中的所有断点,看看你是否有更好的运气。</p></p>
<p style="font-size: 20px;">关于iphone - 声音输出含义,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/11130872/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/11130872/
</a>
</p>
页:
[1]