Re: rendering output to a file
Re: rendering output to a file
- Subject: Re: rendering output to a file
- From: "tahome izwah" <email@hidden>
- Date: Sun, 25 May 2008 22:27:21 +0200
Most likely because you need to define mBytesPerPacket,
mBytesPerFrame, mBitsPerChannel and mFormatFlags to be something other
than 0. The header needs to match the data that you're providing,
otherwise you'll get a format error.
--th
2008/5/22 Ashley Allen <email@hidden>:
> Hi Tahome,
> Thanks for the suggestion. I was able to write to a file and use afplay to
> play it back!!!!
> The following parameters are passed to the ExtAudioFileCreateNew for the
> stream description which works.
> fileformat.mSampleRate = 44100.0;
> fileformat.mFormatID = kAudioFormatMPEG4AAC;
> fileformat.mFormatFlags = 0;
> fileformat.mBytesPerPacket = 0;
> fileformat.mFramesPerPacket = 1024;
> fileformat.mBytesPerFrame = 0;
> fileformat.mChannelsPerFrame = 2;
> fileformat.mBitsPerChannel = 0;
> fileformat.mReserved = 0;
> If I change the format to linear pcm the create call fails complaining about
> the format. I don't understand why. I copied these settings from an
> example, so how they relate to each other is unclear to me. Do different
> encodings require different settings? What's the strategy for determining
> these values? It seems to depend on hardware and data rates. Are there
> formulas or libraries to calculate these settings for different encodings?
> Also, if I try to change the file type from caff to m4af or mp4f, the file
> gets created but the number of bytes are set to zero. Neither QuickTime or
> iTunes can play the contents. I'm doing something wrong considering the file
> should be encoded as a kAudioFormatMPEG4AAC.
> Thanks again,
> Ashley
_______________________________________________
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