leak in a sound function
leak in a sound function
- Subject: leak in a sound function
- From: Agha Khan <email@hidden>
- Date: Sun, 23 Aug 2009 09:53:42 -0700
Hi:
I have a function where I am calling Apple provided sound function.
I have only 2 sounds in my IPhone project. This function play the
sounds correctly.
When I call this function 2nd time I get a leak. I am unable to figure
out what I am doing wrong. Please note if I call this function once
there is no leak.
Any help will be very much appreciated.
Best regards
Agha
+ (void) PlaySound:(int) Index
{
NSBundle* bundle = [NSBundle mainBundle];
SoundEngine_StopBackgroundMusic(FALSE);
SoundEngine_Initialize(44100);
// Assume the listener is in the center at the start. The sound will
pan as the position of the rocket changes.
SoundEngine_SetListenerPosition(0.0, 0.0, kListenerDistance);
SoundEngine_LoadBackgroundMusicTrack([[bundle pathForResource:Index
== 1 ? @"congratulation" : @"Waiting" ofType:@"wav"] UTF8String],
false, true);
//Play start sound
SoundEngine_StartBackgroundMusic();
SoundEngine_StopBackgroundMusic(TRUE);
[bundle release];
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden