[Gambas-user] Music.Length

Patrik Karlsson patrik at ...1931...
Fri Jun 20 13:09:34 CEST 2008


2008/6/20 Benoit Minisini <gambas at ...1...>:
> I don't know why apparently the length of the audio is not encoded in the file
> header...

Ok, I see, at http://www.mp3-tech.org/programmer/frame_header.html I found

"There is no main file header in an MPEG audio file. An MPEG audio
file is built up from a succession of smaller parts called frames. A
frame is a datablock with its own header and audio information.
    In the case of Layer I or Layer II, frames are some totally
independent items, so you can cut any part of MPEG file and play it
correctly. The player will then play the music starting to the first
plain valid frame founded. However, in the case of Layer III, frames
are not always independant. Due to the possible use of the "byte
reservoir", wich is a kind of buffer, frames are often dependent of
each other. In the worst case, 9 frames may be needed before beeing
able to decode one frame."

-- 
Patrik Karlsson




More information about the User mailing list