Skip to main content

Topic: AAC file header (Read 7563 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Jfaul
  • [*]
  • Developer
AAC file header
I saw a description for the AAC file header here:
http://www.audiocoding.com/wiki/index.php?page=AAC , but I could not find how can I get the bitrate/duration from the ADTS header? Does anybody know a better description?

And another question: what encoder uses the ADIF header?

Please help...

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #1
Count the number of frames, then you'll know the filesize, samplerate and number of frames, with that you can calculate the bitrate.
There's no easier way I believe, unless someone here has a good suggestion?

Menno

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #2
BTW: ADTS is the same as the headers in MP3, so you should be able to use about the same code (mind the emphasis bits for MPEG-2).

ADIF is supported by PsyTEL and very old versions of FAAC too (before it had ADTS support). Also, the FhG command line encoders use it by default and all the ISO reference AAC files have an ADIF header.

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #3
> menno: Count the number of frames

Should I read the whole file trough? There must be a better solution, I think...

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #4
How much samples does an AAC frame contain?

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #5
AAC files always have 1024 samples per frame.
In MP4 files it can be 960 too, but I guess you're not working on that yet?

Menno

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #6
What solution are you thinking of? There is no way of telling the number of frames in a VBR file without going through the whole file. There's also no extra header available for that.

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #7
How the ACC-Plugin for Winamp get the duration? It doesn't scan the whole file for calculating the number of frames.

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #8
Yes it does, check aacinfo.c.
It can also be set to check 30 seconds for example and take the average bitrate of that.

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #9
Where can I find the source of the AAC-Plugin for Winamp?

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #10
http://www.audiocoding.com/download.php
Or get the latest code directly from the CVS.

Menno

  • DSPguru
  • [*][*][*]
  • Developer
AAC file header
Reply #11
Quote
Originally posted by menno
AAC files always have 1024 samples per frame.
1024 samples per frame, per channel
DSPguru's Webpage - home of BeSweet & The OggMachine.
BeSplit - 7kb of A loseless AC3/AAC/MP3/MP2/WAV Cutter :)

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #12
Right! :-)

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #13
BTW: Upto channel_configuration == 6 the number of channels is the same as the channel_configuration.
I'll try to add some more info about the headers on the wiki soon.

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #14
Where can I download AAC examples with ADIF header?

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #15

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #16
I would like to implement support for AAC files in my project MPEG Audio Collection , therefore I asked for the info.

1) What kind of AAC files are there?
2) Where can I find other ACC encoders (like FhG etc.)?
3) I need ACC examples (various encoders, modes etc.) - for in-depth tests.

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #17
The ISO reference files found at that at&t website should cover everything. You will not find the FhG encoder that creates AAC files.
There are three different AAC formats possible (4 actually but let's not get into that):
RAW
ADIF
ADTS

You will not be able to extract any info from RAW files unless you decode them (which would make binary distribution of your program illegal). ADIF and ADTS I told about, you can find more info on http://www.audiocoding.com/wiki.

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #18
How can I get the sampling rate from the ADIF header?

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #19
Sampling rate is taken from the sampling_frequency_index in the program_config_element.
I updated the ADIF page to describe this program_config_element:
http://www.audiocoding.com/wiki/index.php?page=ADIF

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #20
Thank you!

  • Mac
  • [*][*][*][*][*]
AAC file header
Reply #21
Aah its cool to see you're adding AAC support to your MAC program  Thanks JF!
< w o g o n e . c o m / l o l >

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #22
I would like to get a sample encoded with the FhG ACC coder. Where can I download one?

  • menno
  • [*][*][*][*][*]
  • Developer (Donating)
AAC file header
Reply #23
If you send me an email, I can send you some.

Menno

  • Jfaul
  • [*]
  • Developer
AAC file header
Reply #24
> menno: If you send me an email, I can send you some.

jfaul at gmx dot de