NimbleKit - fast iOS app development

Sound delayed - Error messages in XCode

Problem discussions

Sound delayed - Error messages in XCode

Postby mikado22 » Thu Mar 08, 2012 2:52 pm

Hi there!

I'm trying to make a simple button sound and used the following code:

Code: Select all
musicplayer2 = new NKAudioPlayer();
           
            function playSound(name)
            {
                var theSoundpath="Sounds/"+name;
               
                musicplayer2.loadFile(theSoundpath);
                musicplayer2.setLoopMode("no");
                musicplayer2.setVolume(15);
                musicplayer2.play();
            }


When I run the project and click the button, which calls the function, there is a delay of about 10 seconds and a lot of warnings in the XCode output window (see below). After the delay everything works fine. Does anybody know what this means?

Thanks for any hint!

OS-Version: 10.7.3
XCode-Version: 4.3

Output window:

2012-03-08 13:39:32.359 hans[19064:17903] 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: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
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-03-08 13:39:32.367 hans[19064:17903] 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: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
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-03-08 13:39:32.702 hans[19064:17903] 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: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
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-03-08 13:39:32.711 hans[19064:17903] 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: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
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-03-08 13:39:32.725 hans[19064:17903] 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: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
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-03-08 13:39:32.733 hans[19064:17903] 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: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
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
mikado22
 
Posts: 3
Joined: Thu Mar 08, 2012 2:42 pm

Re: Sound delayed - Error messages in XCode

Postby ryubr » Thu Mar 08, 2012 4:53 pm

Is it inside the bundle? Have you tried open the sound without the path?
ryubr
NimbleKit Expert
 
Posts: 445
Joined: Fri Jun 19, 2009 5:36 am

Re: Sound delayed - Error messages in XCode

Postby HalfMoon » Thu Mar 08, 2012 4:55 pm

mikado22 wrote:When I run the project and click the button, which calls the function, there is a delay of about 10 seconds and a lot of warnings in the XCode output window (see below). After the delay everything works fine.


The warnings are a known bug with the simulator (see first answer for more detail). I've come across this a few times but as soon as you run on a device then all is fine.

The delay is down to the sound file loading in the player. Once it's loaded and played the first time, afterwards it should play instantly. I vaguely seem to remember seeing some code on the forum that had a preload method to overcome this - might be worth doing a search for it.
:)
User avatar
HalfMoon
NimbleKit Guru
 
Posts: 662
Joined: Thu Jun 04, 2009 6:21 pm
Location: Brighton, UK


Return to Troubleshooting

Who is online

Users browsing this forum: Google [Bot] and 1 guest