Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8225203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:20:20+00:00 2026-06-07T15:20:20+00:00

I am using SimpleAudioEngine to play sounds in my cocos2D application. I have a

  • 0

I am using SimpleAudioEngine to play sounds in my cocos2D application. I have a situation of continues shooting bullets on tapping on a button and playing a sound whenever a bullet is shot.
When i continuously tap the shoot button sometimes, game scene jerks. This started happening when i integrated the sounds.

This is the code i use on button tap :

-(void)rocketButtonTapped:(id)sender
{
  [[SimpleAudioEngine sharedEngine] playEffect:@"rocket_fired.wav"];
  NSLog(@"Pencil Rocket");
  if(int_pencilRocketTagCount>=220)
  {
    int_pencilRocketTagCount=215;
  }
  [self performSelector:@selector(shootPencilRocket)];  
}

Please suggest me a way out… Thanks in advance..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:20:22+00:00Added an answer on June 7, 2026 at 3:20 pm

    Before the game starts, do this:

    [[SimpleAudioEngine sharedEngine] preloadEffect:@"rocket_fired.wav"];
    

    This loads the effect into memory.
    If this doesn’t fix the problem then the issue may be elsewhere. For example too many sound effects playing all at once if the rocket fire sound is several seconds long this could be an issue. Also continuous logging to Debug Console via NSLog or CCLOG is slow and can easily cause framerate to drop.

    It might also help to reduce the sound quality. A sample rate of 22 or even 11 kHz is enough for (short) sound effects, 44 kHz is wasteful as it increases the memory usage 2 or 4 times respectively. If the effect file uses stereo channels, convert it to mono to cut the size in half. The less memory the effect uses, the less it strains the hardware playing it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following method, and express a sound effect in cocos2d. [[SimpleAudioEngine
I am developing a cocos2d IPhone app using the SimpleAudioEngine to play some mp3
I am developing an IOS app using cocos2d and the SimpleAudioEngine for playing a
So I׳m trying to play some effects in my Cocos2D game using SimpleAudioEngine ,
I am playing a song in Cocos2D iphone using this line. [[SimpleAudioEngine sharedEngine] playEffect:@song.mp3];
If I have two objects in chipmunk (I'm using cocos2d-iphone), once I've detected that
I'm currently using the SimpleAudioEngine to play a music file in my NSBundle (iphone)
Hi I am trying to make car engine sound by using SimpleAudioEngine . i
I'm using the SimpleAudioEngine for cocos2d and when one track finished I would like
Using HTML 5, I want to play multiple sounds simultaneously. how can I do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.