Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: AAC header format (Read 8036 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

AAC header format

I want to read some parameters, such as bitrate and samplefrequency,
from a raw aac. But I don't know the header format of aac. Thanks for
your kind help!


AAC header format

Reply #2
Thanks very much for you linkis.
There is  neither adts nor adif header in my aac file as I use -r in faac setting.
and how can i read sample frequency in the raw aac file?
but there is a region at the beginning including some information:
"?  libfaac 1.23.1
(Dec  1 2003)
B ?2 G! I?
"
is it a header of some kind?

AAC header format

Reply #3
Quote
and how can i read sample frequency in the raw aac file?

Usually, you can't. You have to guess and hope that your guess is correct.

AAC header format

Reply #4
thanks very much

AAC header format

Reply #5
In theory, one could write a decoder that could try to decode all supported sampling rates starting from 8000 Hz, up to 96000 Hz, and pick up one that didn't fail decoding (since using wrong sampling rate would definitely generate bitstream error at some point)

There are some problems with this :

- Some sampling rates are using same number of AAC scalefactor bands, like 44.1 kHz and 48 kHz.

- There are bitstreams with bitstream errors inside, not resulting from wrong sampling rate, so that would prevent "guessing" to work properly

So - in most cases, there is no way to decode raw stream unless you know (or guess) sampling rate.  Fortunately,  raw streams are almost never found without proper information outside, like MP4 system data, or RFC 3016 + SDP packets.

AAC header format

Reply #6
Quote
ADTS header format:
http://www.audiocoding.com/wiki/index.php?page=ADTS
ADIF header format:
http://www.audiocoding.com/wiki/index.php?page=ADIF
Program Config Element:
http://www.audiocoding.com/wiki/index.php?..._config_element


I looked into the ADIF header in the link provided .. but I couldn't find the element that would store the Encoder Profile.. Is there some error with the ADIF header format published at "audiocoding.com" ?

 

AAC header format

Reply #7
Quote
In theory, one could write a decoder that could try to decode all supported sampling rates starting from 8000 Hz, up to 96000 Hz, and pick up one that didn't fail decoding (since using wrong sampling rate would definitely generate bitstream error at some point)

That's strange. I always thought that guessing the wrong sampling rate would speed up or slow down the playback speed (changing pitch), and only that.

Quote
I looked into the ADIF header in the link provided .. but I couldn't find the element that would store the Encoder Profile.. Is there some error with the ADIF header format published at "audiocoding.com" ?


Check the bottom element in the table, "program_config_element".