Getting an in-memory template to use with AudioFileInitializeWithCallbacks
Getting an in-memory template to use with AudioFileInitializeWithCallbacks
- Subject: Getting an in-memory template to use with AudioFileInitializeWithCallbacks
- From: David Preece <email@hidden>
- Date: Sat, 23 Jan 2010 23:20:11 +1300
Hi,
I've been working on writing an M4A/AAC file directly across a network socket without first creating a temporary file. To this end I've created a harness that writes an AAC using some test data and two separate techniques:
1, Call AudioFileCreate then wrap the ID with ExtAudioFileWrapAudioFileID
2, Call AudioFileInitializeWithCallbacks and also wrap the ID with ExtAudioFileWrapAudioFileID
The second one then catches the callbacks in an effort to just write them to disk sequentially. However, looking at the "position, write" pairs being passed to the callbacks we can see that the initialise call assumes an intact header of 57334 bytes. Indeed, this is as-designed as I found out from the following post:
http://lists.apple.com/archives/Coreaudio-api/2007/Jul/msg00106.html
"Create is intended to create a new file
Initialise is really a create call - open an existing file, but delete its contents so that it ends up (after Init is finished) in the same states as if you'd called AudioFileCreate to create a new file."
This is fine except that it would imply the need for and existence of an 'AudioFileCreateWithCallbacks' but there isn't one - deprecated or otherwise. So before I start putting a zero length .m4a in my app's resources purely so I can load it into memory prior to wiping it I was wondering if anyone knew of a more elegant solution.
Oh, and I'm targeting 10.4.
Thanks,
David Preece
_______________________________________________
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