Re: AudioFileInitializeWithCallbacks
Re: AudioFileInitializeWithCallbacks
- Subject: Re: AudioFileInitializeWithCallbacks
- From: Norman Franke <email@hidden>
- Date: Mon, 23 Jul 2007 16:07:00 -0700
In that case, it seems like there should be a
AudioFileCreateWithCallbacks to enable creating a new AudioFile into
RAM or whatever. It's not clear to me what should happen when calling
AudioFileInitializeWithCallbacks since nothing really exists, just
callbacks. Perhaps I'm missing something here, but
AudioFileInitializeWithCallbacks doesn't seem to work.
-Norman
Quoting William Stewart <email@hidden>:
The open, create and initialise calls are a little confusing so
we're cleaning them up in leopard.
Open is intended to open an existing file
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. That is, there is essentially no data in the file now.
Which is a bit confusing, so for Leopard we've deprecated the
Initialise call and made a new version of the Create call which
takes a flag to indicate whether you can delete an existing file (or
not).
I think to cleanup the code for Tiger, you'd be better to follow a
similar pattern (and not use the Init calls at all):
if the file exists and its not what you want - use the file system
calls to delete it
then use AudioFileCreate to make a new file
if the file doesn't exist
then use AudioFileCreate to make a new file
-- you'd then typically write data to this new file
if the file exists and it is what you want
then use AudioFileOpen to open it
-- you'd then typically read data from this existing file
So, a little convoluted explanation, but that's how we'd recommend
dealing with this.
Bill
On 23/07/2007, at 12:44 PM, Norman Franke wrote:
I've modified CAAudioFile.cpp (in
/Developer/Examples/CoreAudio/PublicUtility) to call
AudioFileInitializeWithCallbacks instead of AudioFileCreate to
enable writing the file to a RAM buffer, which I'll then stream. My
code (based on afconvert) can successfully use
AudioFileOpenWithCallbacks to read from a buffer, but the call to
AudioFileInitializeWithCallbacks always fails with 'wht?' or
kAudioFileUnspecifiedError.
None of my four callbacks are being called (and that work for
AudioFileOpenWithCallbacks) and the same file type and description
are being bassed to AudioFileInitializeWithCallbacks that were
being passed to AudioFileCreate originally.
Has anyone used AudioFileInitializeWithCallbacks successfully?
-Norman
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
__________________________________________________________________________
_______________________________________________
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
_______________________________________________
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