Re: ExtendedAudioFile (AAC issue)
Re: ExtendedAudioFile (AAC issue)
- Subject: Re: ExtendedAudioFile (AAC issue)
- From: William Stewart <email@hidden>
- Date: Mon, 6 Aug 2007 12:11:45 -0700
The 2112 is the priming frames for the encoder. Typically an AAC bit
stream will be at least this much longer than data it actually has in
the file. The FileLengthFrames property should tell you exactly how
many valid frames there are in a file - and for a CAF file this
should be exact. Unfortunately, for other file types (inc. MP4 and
ADTS or .aac) this information may not be in the file, so default
behaviour is used in the codec which is mostly correct (most AAC
encoders have a 2112 priming addition to the bit stream they
produce). So, ExtAudioFile will do its best based on the information
we can glean from the file. You should always pull as much as you can
and not decide to stop at a particular limit.
This 2112 is normally additions at the start of the file. At the end
of a compressed bit stream you have a similar problem (what we've
called trailing frames in CAF files). In fact the CAF File document
goes into some detail to explain this (see the PacketTable Chunk) -
essentially the problem is retaining sample accurate length
information in compressed files. Compressed formats invariable chunk
up data, but if your original file is not an even divisible of a
chunk size, then you have the problem of remainder frames to deal
with. AIFF files (that can contain IMA and other CBR formats) have
this problem. There is also no notion of this in MPEG bit streams
(.mp3 for instance).
Bill
On 02/08/2007, at 2:51 PM, thomas rettich wrote:
How are you computing that you are missing 2112 frames?
I am retrieving the total frame count of the file with the
ExtendedAudioFile kExtAudioFileProperty_FileLengthFrames
property.
So with AAC files if it tells me x frames total, it doesn't
actually read x frames but after (x-2212) frames it keeps
returning 0 frames if I try to read any further.
Is this expected ?
(if I use iTunes to convert the same file to AAC I can actually
read the whole amount of frames that
kExtAudioFileProperty_FileLengthFrames tells me in the first place).
Thanks,
Thomas
----------------------------------------
CC: email@hidden
From: email@hidden
To: email@hidden
Subject: Re: ExtendedAudioFile (AAC issue)
Date: Thu, 2 Aug 2007 11:57:20 -0700
How are you computing that you are missing 2112 frames? number of
packets times 1024 frames per packet? If so, you are missing the fact
that the AAC encoder has 2112 frames of priming which do not show up
in the output. This priming info is encoded into CAF files and can be
obtained. Different encoders may have different priming.
On Aug 2, 2007, at 11:44 AM, thomas rettich wrote:
Hi,
I use extendedAudio file API to write and read compressed AAC files.
My file writing code is based on the RecordAudioToFile (sample
code).
ASBD = {44100.0, kAudioFormatMPEG4AAC, 0, 0, 1024, 0, 2, 0, 0};
when I try to read the AAC files created with ExtendedAudioFileRead,
all works fine,
except,
I cannot read the last 2112 frames.
ExtendedAudioFileRead always returns 0 frames, for these remaining
ones.
could there be a problem in the file writing sample code, or is
there something I have to set up in the reading
with extended audio file to be able to extract all frames ?
Any hints on how to sole this would be much appreciated!
Thanks in advance,
Thomas
_________________________________________________________________
Gefunden! Tolle Bilder von Kati Witt gibt es hier!
http://search.msn.de/images/results.aspx?q=katarina%
20witt&form=MIDGPS
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40apple.com
This email sent to email@hidden
_________________________________________________________________
The show must go on! Ihre Diashow auf Ihrem Space! Jetzt loslegen!
http://get.live.com/spaces/overview
_______________________________________________
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
--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
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