Search Results

Search found 1 results on 1 pages for 'user2779450'.

Page 1/1 | 1 

  • iphone-AVAudio Player Crashes

    - by user2779450
    I have an app that uses an avaudio player for two things. One of them is to play an explosion sound when a uiimageview collision is detected, and the other is to play a lazer sound when a button is pressed. I declared the audioplayer in the .h class, and I call it each time the button is clicked by doing this: NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"/lazer" ofType:@"mp3"]]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; if (error) { NSLog(@"Error in audioPlayer: %@", [error localizedDescription]); } else { [audioPlayer prepareToPlay]; } [audioPlayer play]; This works fine, but after many uses of the game, the audio will stop play when i hit the button, and when a collision is detected, the game crashes. Here is my crash log: 2013-09-18 18:09:19.618 BattleShip[506:907] 18:09:19.617 shm_open failed: "AppleAudioQueue.41.2619" (23) flags=0x2 errno=24 (lldb) Suggestions? Could there be something to do with repeatedly creating an audio player? Alternatives maybe?

    Read the article

1