Re: FLLR (compression ?) in AIFF file
Re: FLLR (compression ?) in AIFF file
- Subject: Re: FLLR (compression ?) in AIFF file
- From: "Francois Baronnet" <email@hidden>
- Date: Wed, 6 Aug 2008 21:28:00 +0200
2008/8/6 Stephen Davis <email@hidden>:
> On Aug 6, 2008, at 10:44 AM, Francois Baronnet wrote:
>
>> 2008/8/6 Richard Dobson <email@hidden>:
>>>
>>> Stephen Davis wrote:
>>>>
>>>> The FLLR chunk is added by the AudioFile code to align the data chunk on
>>>> a
>>>> 4K page boundary for optimized I/O during playback.
>>>>
>>>> The AIFF specification says to ignore chunks you don't recognize and
>>>> skip
>>>> over them. This is such a chunk. :-)
>>>>
>>>> As for the NONE chunk, it is not a separate chunk but is found in the
>>>> "compressionType" field of the COMM chunk.
>>>>
>>>
>>> Only in AIFC files (the COMM chunk is larger there with extra fields).
>>> AIFF
>>> does not support compression (or 32bit floats). But the recommendation is
>>> that AIFC supercedes AIFF, so should be used for everything, these days.
>
> Oops, Richard is correct.
>
>>>
>> Ok, thanks. As I'm the recorder of the sound and then there is only me
>> to analyse it (then the sound file is deleted), I thing I can use
>> uncompressed AIFF, no?
>>
>> Please correct me if I go wrong, but if I move to the SSND chunk, I
>> should find very closed to it the "sound data", shouldn't I?
>> And these data must be of type float, from -1.000 to 1.000, right? If
>> it's true, then I don't understand why I'm getting stange numbers
>> (xxx.xx E-41 for example).
>>
>> Here is a screenshot of my file opened with some hexadecimal editor.
>> My app is reading from 00 22 00 00 until the end of file.
>> http://cpcstats.free.fr/upload/files/1218044603_Image_1.png
>>
>> May be it's not float? May be the offset isn't good? I tried many
>> combinations but I can't get one "good" float value...
>
> Your original email said your file audio format was:
>
>> Here are my settings for AIFF file:
>>
>> aqData.mDataFormat.mFormatID = kAudioFormatLinearPCM;
>> aqData.mDataFormat.mSampleRate = 44100.0;
>> aqData.mDataFormat.mChannelsPerFrame = 2;
>> aqData.mDataFormat.mBitsPerChannel = 16;
>> aqData.mDataFormat.mBytesPerPacket =
>> aqData.mDataFormat.mBytesPerFrame =
>> aqData.mDataFormat.mChannelsPerFrame * sizeof (SInt16);
>>
>> aqData.mDataFormat.mFramesPerPacket = 1;
>> AudioFileTypeID fileType = kAudioFileAIFFType;
>>
>> aqData.mDataFormat.mFormatFlags =
>> kLinearPCMFormatFlagIsBigEndian
>> | kLinearPCMFormatFlagIsSignedInteger
>> | kLinearPCMFormatFlagIsPacked;
>
> You're setting the data to 16-bit linear integer PCM. Why are you expecting
> to read 32-bit floats?
>
> stephen
>
>
Oooops...
Now I'm reading my data (16 bit float) 2 bytes by 2 bytes (first 30
000) and I'm getting all values between -1.999 and -1.991.
float value;
int i=0;
do
{
[[theFileHandle readDataOfLength: 2] getBytes: &value];
NSLog(@"%f",value);
chunkSize -= 2;
i++;
}while(chunkSize > 0 && i < 30000);
I haven't plot my values but I'm pretty sure it won't look like a nice
wave as I can see in Audacity...
--
François Baronnet
_______________________________________________
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