Re: Capturing AU output to file
Re: Capturing AU output to file
- Subject: Re: Capturing AU output to file
- From: Jeff Evans <email@hidden>
- Date: Fri, 10 Apr 2009 17:20:35 -0700
Continuing to search for causes of the fmt? error I've run into two
issues
- I see that the Core Audio documentation describing the
AudioStreamBasicDescription is tagged as a "Legacy document - not to
be used for new development." Is there something else that we should
be using instead? I ran into a similar Legacy Document warning
elsewhere once and was basically told that it didn't mean anything,
though - maybe this one is like that?
- ExtAudioFileCreateNew is deprecated, replaced by
ExtAudioFileCreateWithURL. I've tried, just for kicks, to use the new
one instead - it's much cleaner and can erase an existing file - but
it comes up as "undefined" in XCode even if I switch the project
settings to 10.5 and the target SDK to 10.5. I can see that this call
is defined in the version of ExtAudioFile.h found in the 10.5 SDK. Is
this a known glitch?
Thanks, Jeff
On Apr 10, 2009, at 2:57 PM, Doug Wyatt wrote:
e.g. to make a 16-bit stereo AIFF:
AudioStreamBasicDescription filefmt;
filefmt.mSampleRate = auRenderSampleRate;
// you probably don't want to guess on the sample rate; get the AU's
rate
filefmt.mFormatID = kAudioFormatLinearPCM;
filefmt.mFormatFlags = kAudioFormatFlagIsSignedInteger |
kAudioFormatFlagIsPacked;
filefmt.mBytesPerPacket = filefmt.mBytesPerFrame = 4;
filefmt.mFramesPerPacket = 1;
filefmt.mChannelsPerFrame = 2;
filefmt.mBitsPerChannel = 16;
On Apr 10, 2009, at 14:40 , Doug Wyatt wrote:
On Apr 10, 2009, at 14:34 , Jeff Evans wrote:
Thanks, Doug - though as you say, AudioUnitGetProperty is used to
fill in the ASBD based on the characteristics of the synth, which
is the DLS synth. Then that ASBD is applied to the external file
using ExtAudioFileSetProperty. The sample code doesn't include any
other way of setting the output format, aside from specifying the
type (WAVE, AIFF, CAF, etc.). I don't see why this sample code
would work, given what you say below. Actually I have no proof
that the sample code does work, I suppose.
In any event I've tried specifying CAF file output too, but
ExtAudioFileCreateNew still fails with the unsupported format error
with the ASBD filled out as per the sample code. Is the sample code
missing some way to set up a separate ASBD for the output file?
Sorry, I have no idea of what sample code you are looking at or
where to find it. I do, however, have a copy of
CAAudioUnitOutputCapturer.h in front of me. What is the audio data
format being passed to the constructor? If you get an error even
when specifying CAF, then most likely the data format is not
correctly filled out.
Doug
--
If this email is spam, report it here:
http://www.onlymyemail.com/view/?action=reportSpam&Id=MTAxOTYyOjg3NjgyNzg5NjpqZXZhbnNAYXJzLW5vdmEuY29t
_______________________________________________
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