I'm experiencing a strange behavior with the AVAudioPlayer component.
Following many examples, i've set up my AppDelegate, in order to play
a loop sound during the main screen of my app. The code sounds like
the following:
/*sound loop stuff*/
NSString *soundFilePath = [[NSBundle mainBundle]
pathForResource:@"gong" ofType:@"mp3"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath];
AVAudioPlayer *newPlayer = [[AVAudioPlayer alloc]
initWithContentsOfURL:fileURL error:nil];
[fileURL release];
self.loopSoundPlayer = newPlayer;
[newPlayer release];
[loopSoundPlayer setDelegate:self];
[loopSoundPlayer setNumberOfLoops:0];
[loopSoundPlayer prepareToPlay];
Also, the loopSoundPlayer is declared with a @property(nonatomic,
retain) constructor, in order to access the instance methods and
properties from the viewController class.
All seems to work fine, but if i check against memory leaks, i found a
spike in the very first part of the execution. Something like this:
208Bytes 0xd1f8a0 GeneralBlock-208
208Bytes 0xd1f970 GeneralBlock-208
208Bytes 0xd1fcf0 GeneralBlock-208
208Bytes 0xd1fe40 GeneralBlock-208
208Bytes 0xd1f700 GeneralBlock-208
32Bytes 0xd174e0 SegmentMachO
32Bytes 0xd1f6a0 SegmentMachO
32Bytes 0xd1f6e0 SegmentMachO
...
...
If i inspect every entry, using the details arrow button i found
*ONLY* audio related functions.
What's the problem? Is it my mistake? Is there a SDK bug?
best regards
--
gpg.0x1D67B4DD