• 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
Re: AudioFileOpenWithCallbacks...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioFileOpenWithCallbacks...


  • Subject: Re: AudioFileOpenWithCallbacks...
  • From: james mccartney <email@hidden>
  • Date: Fri, 10 Jul 2009 09:43:44 -0700


It doesn't read the whole file unless you are calling AudioFileReadPackets to cause it to do so.
The purpose of the callbacks is to be able to provide audio file data from a source other than a file (e.g. memory).
Your read callback gets called whenever AudioFile would have otherwise issued a read to the file system.
Upon opening the file, it will call your read callback as necessary to parse the hearder -- that's it. After that you need to call AudioFileReadPackets to get the packets from the file.. which will turn around and call your read callback to get the data.


AudioFileOpenWithCallbacks is not an asynchronous file loader.

On Jul 10, 2009, at 4:45 AM, Gavin Burke wrote:

Currently I am struggling with opening an audio file. In a previous version of my software I used an iostream, timers, fread and my own file opening function for parsing the wav file header, getting the data etc. This was fine as I was only opening a fixed set of files.

Now that I want to open multiple file types I am trying to switch to AudioFile.h functions.

Looking at the documentation, AudioFileOpenWithCallbacks seems to be what I need, AudioFileOpenWithCallbacks providing for async file load so I don't block everything waiting for a large file to open.

Currently this is what I am doing below. AudioFile_ReadProc only gets called once, I thought the purpose of OpenWithCallbacks is that it keeps being called until you have read
the entire file? There is nothing really on this process anywhere so some advice/explanation would help.




_______________________________________________ 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
References: 
 >AudioFileOpenWithCallbacks... (From: Gavin Burke <email@hidden>)

  • Prev by Date: Re: AudioUnits: Threading of property fetching and Render-proc
  • Next by Date: Re: how to access HAL buffer timestamps when using AUHAL?
  • Previous by thread: AudioFileOpenWithCallbacks...
  • Next by thread: Re: AudioUnits: Threading of property fetching and Render-proc
  • Index(es):
    • Date
    • Thread