Log in

View Full Version : How to program a aac cutter?


svenali
29th July 2008, 17:13
Hello all!

My experience with mp2-files were easy. I could cut after every frame. But how can I cut an aac coded audio stream? I read, that the frames have a variable length.

My Question are:
1. How to cut such a stream?
2. Whats about the audio-frame length of these aac-files? (An Audio-Frame for a PAL Video had a duration of 24 ms.)

regards,
Sven

tebasuna51
29th July 2008, 18:14
My experience with mp2-files were easy. I could cut after every frame. But how can I cut an aac coded audio stream? I read, that the frames have a variable length.
Have the aac stream ADTS headers or is inside a mp4 container?

My Question are:
1. How to cut such a stream?
If is an .aac file (ADTS header) you can see a header description (variable frame length field) here (http://www.hydrogenaudio.org/forums/index.php?showtopic=64890#)

2. Whats about the audio-frame length of these aac-files? (An Audio-Frame for a PAL Video had a duration of 24 ms.)
?
The audio frames never match video frame duration:
mp3 have always 24 ms for PAL or NTCS
ac3 have 32 ms (48000 Hz) for PAL or NTSC

The standard for aac is 1024 samples per frame, then if samplerate is 48000 you have 1024/48000 = 21.333... ms per frame.

svenali
29th July 2008, 22:03
Wow!

That is exactly the answer I was looking for!!! Thanks very much. I tried to google that the half day!

Good night,
Sven