ExtAudioFileCreateNew questions
ExtAudioFileCreateNew questions
- Subject: ExtAudioFileCreateNew questions
- From: "Kevin Dixon" <email@hidden>
- Date: Sat, 29 Mar 2008 22:02:50 -0400 (EDT)
- Importance: Normal
I'm opening a given file, to be processed offline, and then saved into
another file. I'm using ExtAudioFile for this.
When I go to create the new file, I first open the source file and get its
stream description and channel layout. I cache these, and then call
ExtAudioFileCreateNew as shown here
OSStatus error = ExtAudioFileCreateNew(&fileSystemFile, cfFileName,
kAudioFileAIFFType, &fileFormat, &fileLayout, &outputFile);
where fileSystemFile is an FSRef to the directory to save in, cfFileName
is the CFStringRef for the file name, AIFF format, and fileFormat is the
input file's stream description and fileLayout is the input file's channel
layout. outputFile is the ExtAudioFileRef.
When I execute this code, error = 1718449215 and outputFile is set to
NULL, which would seem to indicate failure. However before I call
...Dispose I notice the file has been created in the appropriate place on
my hard disk.
--What could be causing such a failure? Some invalid combination of
arguments?
Also, I was originally hoping to use the same output file format (e.g. WAV
in WAV out) as the input, but I couldn't see an easy way to map
AudioStreamBasicDescription.mFormatID or something to an AudioFileTypeID.
I realize that more varieties of formats can be read than can be written,
but if both are available, I would prefer to use the same in/out format.
Any suggestions to this end?
Thanks in advance!
-Kevin
_______________________________________________
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