Re: AudioFileInitializeWithCallbacks
Re: AudioFileInitializeWithCallbacks
- Subject: Re: AudioFileInitializeWithCallbacks
- From: William Stewart <email@hidden>
- Date: Mon, 23 Jul 2007 19:57:58 -0700
Yes - I think you are right.
On 23/07/2007, at 4:07 PM, Norman Franke wrote:
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:
40apple.com
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:
40bethzur.com
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
--
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