• 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
Whats the Correct way to dispose of AudioFileID and prepare for reuse
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Whats the Correct way to dispose of AudioFileID and prepare for reuse


  • Subject: Whats the Correct way to dispose of AudioFileID and prepare for reuse
  • From: Barry Duggan <email@hidden>
  • Date: Mon, 16 Jul 2012 12:57:36 +0100

I've tracked down some memory abandonment issuses in Instruments allocations. I've quite positive that the problem is coming from improper use of audiofileid.

I have a fileplayer unit and a single audiofileID that it uses.

My use case is

  • Select a file.
  • Open the file With audioFileID
  • Repeat


How I try to do this is as follows.


AudioFileOpenURL(audioURL,kAudioFileReadPermission,0,audiofileidobject)

Uint32 defaulVal=0;

//Instruments points to this line as source of memory abondonment

AudioUnitSetProperty(fileplayerUnit,kAudioUnitProperty_ScheduleFilePrime,kAudioUnitScope_Global,0,&defaultVal,sizeof(defaultVal));


I tried to free the audioFileID from memory using the following code before opening another URL but this crashed my app.


if(audiofileidobject)

{

AudioFileClose(audiofileidobject);

}


So my question is how to properly housekeep audiofileID's for reuse?


Does AudioFileOpenURL reinitilize audiofileID memory or could there be some memory accumulation going on here?



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Rendering samples from AudioGraph
  • Next by Date: convert kAudioSessionProperty_CurrentHardwareOutputVolume to dB value
  • Previous by thread: Rendering samples from AudioGraph
  • Next by thread: convert kAudioSessionProperty_CurrentHardwareOutputVolume to dB value
  • Index(es):
    • Date
    • Thread