stevek
Aspiring developer
Profile
Posts: 808
Reg: Dec 24, 2011
great neck
8,080
10/17/15 01:23 PM (9 years ago)

Audio Player errors

Trying to debug. Set up breakpoints. Ran app, it compiled fine but when the simulator runs I get an error. The breakpoint points to appDelegateLoad SoundEfects and the line of code is [tmpPlayer prepareToPlay]; which occurs in this section of code: //fill an array of pre-loaded sound effect players self.soundEffectPlayers = [[NSMutableArray alloc] init]; for(int x = 0; x < [self.soundEffectNames count]; x++){ NSString *theFileName = [self.soundEffectNames objectAtIndex:x]; if([BT_fileManager doesFileExistInBundle:theFileName]){ NSURL *soundFileUrl = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], theFileName]]; NSError *error; AVAudioPlayer *tmpPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:soundFileUrl error:&error]; [tmpPlayer setNumberOfLoops:0]; [tmpPlayer prepareToPlay]; [tmpPlayer setDelegate:self]; [self.soundEffectPlayers addObject:tmpPlayer]; [tmpPlayer release]; } } //release pool [pool release]; } I don't have any sound effects in my app so I don't need any audio players. What is the quickest way to get rid of this error, that is, is there a way and would it be safe to delete all lines that refer to an audio player? Thanks
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
10/18/15 07:10 PM (9 years ago)
Looks like alot of old style obj-c coding. What plugin is this?
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.