iphone - SimpleAudioEngine takes time to play sound -
I use SimpleAudioEngine to play sound in my cocos2D application I am If I have to tap on a button and shoot a bullet, then the sound of the sound is going to continue shooting pills. When I continually tap the button to shoot, the game footage shocks this when I am integrating sounds
This is the code that I tap on the button:
- (zero) rocket buttontap: (id) sender {[simple audio engine shared engine] playfact: @ "rocket_ford.WOW"]; NSLog (@ "pencil rocket"); If (int_pencilRocketTagCount> gt = 220) {int_pencilRocketTagCount = 215; } [Self Performance Selector: @Sillector (Shoot Pencil Rocket)]; } Please suggest me a path ... thanks in advance ..
Before the game starts, do this:
[[SimpleAdOonIngin Shared Eggine] Preload Effect: @ "Rocketfire.wave"]; This effect loads into memory if the problem does not fix it then the problem may be somewhere else. For example, many sound effects play at once if the rocket fire sound is several seconds long then this can be a problem. Continuous logging is slow with the debug console via NSLog or CCOLG and may be due to easily leaving the framemate.
It can also help reduce the quality of the sound. A sample rate of 22 or 11 kHz (short) is enough for sound effects, 44 kHz is useless because it uses memory usage 2 or 4 times Increases gradually. If the effect file uses stereo channels, then change it to cut the half size in mono. The effect uses less memory effects, less this hardware rings it.
Comments
Post a Comment