Re: File format conversion
Re: File format conversion
- Subject: Re: File format conversion
- From: Fredrik <email@hidden>
- Date: Thu, 5 Feb 2009 03:16:28 +0100
Thank you guys. I got a hint earlier as well to use or instead of
commas. After I changed it the AudioConverter works as expected and
writes the buffer as big endian. The size of the data isnĀ“t written in
the header still though. I have tried to edit it in a hexeditor and
then the file plays normally so this seems to be what is left to solve
for me. Could this be a result of the offset parameter being hardcoded
as 0 at the moment? I noticed that no information on the data size is
expected in the argument fields of AudioFileCreate so I assume that it
get this information from elsewhere.
Fredrik
5 feb 2009 kl. 02.56 skrev Brian Willoughby:
Fredrik, the comma operator will compile, but it won't work. The C
language allows you to combine any number of expressions on a single
line using commas, but those expressions are not related to each
other in any way. Your code is assigning Big Endian, but dropping
the Signed Integer and Packed flags.
I bet that if you turned on compiler warnings, it would tell you
that you have orphaned expressions which are doing nothing.
Bill's suggestion below is absolutely correct, although I would
change the description from "usually" to "must always" !!
Brian Willoughby
Sound Consulting
On Feb 3, 2009, at 10:36 PM, Fredrik wrote:
So, your format flags aren't complete. You need:
kAudioFormatFlagIsBigEndian
kAudioFormatFlagIsSignedInteger
kAudioFormatFlagIsPacked
Yes, that makes sense. I added these flags. What is the proper way
to do that though? I just separated them by commas now, and that
compiled fine. Like this:
OutFormat.mFormatFlags = kAudioFormatFlagIsBigEndian,
kAudioFormatFlagIsSignedInteger,
kAudioFormatFlagIsPacked;
I usually or them in:
OutFormat.mFormatFlags = kAudioFormatFlagIsBigEndian |
kAudioFormatFlagIsSignedInteger |
kAudioFormatFlagIsPacked;
Bill
_______________________________________________
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