Cocos2d app with SimpleAudioEngine

I am developing a cocos2d IPhone app using the SimpleAudioEngine to play some mp3 sounds. My problem is that when I resume the app after a long time it is in background some sounds are no longer played. Have you ever experienced this? Do you know if there is any way to fix it?

Thank you in advance

Andrea

-------------Problems Reply------------

Cocos2d retains/releases the [SimpleAudioEngine sharedEngine] and I don't think that you have control of this outside of the sharedEngine.

The key to this might be how you address in the appdelegate how your app resigns and becomes active.

It is not good to keep all your audio files in memory, especially if the app has been resigned for some time and thus, [SimpleAudioEngine sharedEngine] takes care of the memory management.

Category:iphone Views:1 Time:2011-08-25

Related post

  • Cocos2d apps crash on device but run on simulator just fine 2012-04-14

    Cocos2d apps crash on device but run on simulator just fine. I get "error: failed to launch '/Users/user/Library/Developer/Xcode/DerivedData/ appname-erbohpyunldppdeoivvobopinufc/Build/Products/Debug-iphoneos/ appname.app/ appname -- failed to get th

  • Unexplainable 16MB malloc in cocos2d app? 2011-03-15

    I am developing a cocos2d based app and I am now testing it against the Allocations Tool to check whether some leakage is present. I have noticed there are instants at which a malloc of 16 MB occurs and I can actually not say why. I guess it is somet

  • Possibilities to reduce power consumption with cocos2d apps 2011-06-06

    I made a board game with includes just some little animations. I reduced the fps from 60 to 30 to reduce the processor load. But the device still gets very warm. Another application made without cocos2d is not heating it so much. Are there any method

  • iphone cocos2d app and iAd 2011-06-20

    I have an iphone 3 device running iOS 3.1.2, I developed a game using cocos2d, i implemented iAd in the lite version (free app), what i did is that i made the iAd framework role "weak" instead of "required", and i made the base SDK iOS 4.2 as it is,

  • How to get a cocos2d app to use iPad? 2011-06-23

    I have an iPhone app I developed using cocos2d. I have the correct version which supports iPad. Now, how do I get it to change the screen resolution or to recognize that it is an iPad app and not an iPhone app? --------------Solutions------------- Yo

  • Cocos2d App is Freezing 2011-09-29

    I'm creating a game app using cocos2d Chipmunk. The app is working normally but after 30 to 40 seconds the app becomes unresponsive(app freezes) without any error log. Can any tell me why this is happening and how to overcome this problem. Please tel

  • How can I resolve these errors when building a cocos2d app under Xcode 4.2? 2011-11-01

    My app compiled fine before, but I'm now seeing the following errors when building with Xcode 4.2: In GLES-Render.mm it is reporting: variable length array of non pod element type b2vec2 and `cannot initialize parameter of type CCScene with an rvalue

  • Cocos2d app working on all device except iPhone 4 (any OS) with CCBatchnode just showing black screen after addchild 2012-04-10

    I've been in this site for a long time and this is my first time to post a question. I'll try to as descriptive as possible as I hope someone can answer about this strange behavior I have. I've developed an app call Linsanity Rush for iPhone and I've

  • Integrating iAd into an existing Cocos2D app? 2011-02-06

    How would I integrate iAd into an existing Cocos2D game? --------------Solutions------------- I have not actually done it before. But here is a link that might help on intergating UIKit and Cocos2D. http://www.raywenderlich.com/4817/how-to-integrate-

  • App crashing in cocos2d app on device when nothing happening 2012-01-17

    I have a somewhat simple game that I'm making and now that I'm testing what I consider a bare bone version of the app on devices, I keep getting crashes over and over. I'm fairly new at debugging on actual devices, so any help would be great. The rea

  • cocos2d apps in simulator exit immediately but without any error message 2012-03-03

    I'm using Snow Leopard and Xcode 3, and I'm using the files for Learn iPhone and iPad Cocos2D Game Development, but every project I tried only shows the "Powered by Cocos2d" and exit. Any ideas? enter 2012-03-03 21:24:05.547 RocketMouse[9109:207] coc

  • Where do I attach the StoreKit delegate and observer in a Cocos2d App? 2010-05-08

    I have figured out how all of the StoreKit stuff works and have actually tested working code... however, I have a problem. I made my "store" layer/scene the SKProductsRequestDelegate. Is this the correct thing to do? I get the initial product info li

  • App crashes on backgrounding because of SimpleAudioEngine 2010-10-01

    So I׳m trying to play some effects in my Cocos2D game using SimpleAudioEngine , but after I have added them my app crashes when it goes to background (multitasked). I searched for this problem in the internet but all the solutions that I found didn't

  • Integrating cocos2d in an existing app - OR - where does the white rectangle come from? 2010-07-23

    I have created a "normal" app - initially without cocos2d. Now I need cocos2d in this app. So I added all the frameworks that are included when creating a cocos2d app and just copied the cocos2d group from another project by dragging it to my project

  • Which cocos2d scene is currently active when returning from suspended app state 2011-03-10

    The environment is an iOS device with multitasking support, like an iPhone4. I'm in a cocos2d app with a Main Menu that leads to several Scenes. If I switch to another app using the taskbar, then switch back, how do I programmatically tell which scen

  • Cocos2d background music preload 2011-09-10

    I am developing an IOS app using cocos2d and the SimpleAudioEngine for playing a background music in different scenes. The problem is that if a preload the background music it plays in the first scene but it is stopped when i turn to a different scen

  • UITableView with cocos2d 2009-02-05

    I am a learner in the area of Objective-C. I'm trying to build an iPhone app with cocos2d. Now I would like to use a UITableView to show data from an XML file. Is it possible to use UITableView with cocos2d and is it also possible to retrive data fro

  • Cocos2d on iPad at native res and not inside box 2010-06-14

    So I can't seem to get my cocos2D app to run at native resolution on the iPad. All it does it run in the little box as if it's an iphone application. I have the latest version of cocos2D inside my app and used the templates to create the project. Any

  • Cocos2D crashing on iPhone immediately but not in simulator 2011-05-18

    I'm trying to test a Cocos2D app on an iPhone, and get this crash that I copied from the console: cocos2d: CCSpriteFrameCache: Trying to use file 'heroTestSheet.png' as texture cocos2d: CCTexture2D. Can't create Texture. UIImage is nil cocos2d: Could

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.121 (s). 11 q(s)