Help - Search - Members - Calendar
Full Version: How to determine if AAC has SBR and PS?
Hydrogenaudio Forums > Lossy Audio Compression > AAC > AAC - Tech
romano
I wrote a source client for Icecast. It parses AAC, AAC+ and AAC+v2 files from disk and sends them to Icecast with a correct bitrate. This makes it possible to stream AAC directly from files (no realtime reencoding, no extensive CPU use) and thus enabling you to stream say AAC+v2 48kbps (very good quality but small file size) with an old Pentium-166. If anyone is interested, see http://aeons-back.livejournal.com/8714.html

I managed to successfuly parse ADTS headers of AAC files, but I still need to determine correctly if this particular AAC has SBR (AAC+) or both SBR and PS (AAC+v2). It is necessary to determine the real samplerate and number of channels to send the correct information to Icecast server. Well, to be honest, all players seem to play my AAC stream correctly, even if Icecast receives incorrect samplerate and number of channels (for example I get 22050Hz, 1 channel for audio that is in fact 44100Hz, 2channels and having both SBR and PS). Information about SBR and PS is not available in ADTS headers. For determining this I think I should parse the raw AAC frames for which I can't find a good specification sad.gif

My question is how do I know if AAC has SBR and PS? Does anyone know of a recent specification of AAC with SBR and PS data explained?
pepoluan
Open with WinAmp, the latest build, select the file on the playlist, do an Alt-3 (or right-click anddd... that entry on the left of Alt-3).
adamjk
QUOTE(pepoluan @ Sep 11 2006, 15:52) *

Open with WinAmp, the latest build, select the file on the playlist, do an Alt-3 (or right-click anddd... that entry on the left of Alt-3).

Are you crazy or maybe you have forgotten English language and you are not able to understand romano's question?
Number of posts is not equal to IQ, my dear Pepoluan!
pepoluan
QUOTE(adamjk @ Sep 11 2006, 22:56) *
QUOTE(pepoluan @ Sep 11 2006, 15:52) *
Open with WinAmp, the latest build, select the file on the playlist, do an Alt-3 (or right-click anddd... that entry on the left of Alt-3).
Are you crazy or maybe you have forgotten English language and you are not able to understand romano's question?
Number of posts is not equal to IQ, my dear Pepoluan!
Ah, okay. I misread OP then. I thought he/she was asking about .aac files. My bad.

Can't help you then.


volleyballa
Hi romano,

I think the only specification you will find the ISO/IEC 14496-3:2001/AMD1,2003 Bandwidth Extension and the AMD2:2004, Parametric Coding for High Quality Audio. But you would have to buy both of them here:

http://www.iso.org/iso/en/CatalogueDetailP...?CSNUMBER=42739

Maybe the 3GPP spec (26401-26411) helps a bit, although the bitstream is not described in detail...

http://www.3gpp.org/ftp/specs/html-info/26-series.htm

However, you could have a look at the given source code and find out how they do it.

Greetinx,
volleyballa
Xurya
QUOTE(romano @ Sep 11 2006, 05:34) *

and thus enabling you to stream say AAC+v2 48kbps (very good quality but small file size)

48 kbps? 24 kbps is still good, even at 16 kbps this not bad for streaming


HotshotGG
http://www.ebu.ch/en/technical/trev/trev_305-moser.pdf

Here I think this is what you are looking for hopefully wink.gif
Gambit
omg, 6 replies and no real answer. Anyway...

The only way is to decode a frame and see if it returns SBR data. Raw AAC files don't have that info stored anywhere, only AAC in MP4.
Garf
QUOTE(Gambit @ Oct 22 2006, 01:09) *

The only way is to decode a frame and see if it returns SBR data. Raw AAC files don't have that info stored anywhere, only AAC in MP4.


Actually, you're also wrong on both counts. There's no requirement for MP4 with AAC to have SBR indicated in the headers. It's still correct not to have it marked and have SBR or PS data in the stream anyway.

Likewise, decoding a frame and not seeing any SBR or PS info doesn't mean you can't find it further up in the stream anyway. Most players decode a few frames and base their decision upon that, which is reliable enough in most cases. You could decode entire files, too. Then you'll be sure. Until someone adds another extension to AAC smile.gif

The safe and solid solution, particularly for a streaming application, is to assume SBR and PS can happen upon you at any time. This is also why the players will still work if you give them incorrect info.


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.