• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
leak in a sound function
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: leak in a sound function
      • From: David Duncan <email@hidden>
    • Re: leak in a sound function
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: How to interact with Web pages using Cocoa?
  • Next by Date: Re: Making an NSTableView Display Articles From An RSS Feed.
  • Previous by thread: Re: How to interact with Web pages using Cocoa?
  • Next by thread: Re: leak in a sound function
  • Index(es):
    • Date
    • Thread