hi friends :*


maybe someone of you could have some experience on it. I would to display the samples of an mp3 in a frequency/time diagram. I've already written an asm routine that scan the frames, and read them correctly. Now i don't know, inside a frame, how many bytes are per sample, or the exact meaning of the frame content.

I was looking for some detailed documentation. If some help, infinite thanks,

hi Bit7
Posted on 2004-05-30 06:48:01 by Bit7
---------
- frame length of mpeg1.0:
layer1 :
(48000*bitrate)/sampling_freq + padding
layer2&3:
(144000*bitrate)/sampling_freq + padding
---------------
"padding" is the 23rd bit of the frame header

Search for a file bitstream.zip , 103kB, inside is "MPEG Layer3 Bitstream Syntax andDecoding.doc", it describes almost everything you might need to know. Pride and optimisations apart, there are 2 packages that I (like most people) have found best - 1)mpg123 and 2)MAD. Actually, concentrate mostly on mpg123 - small filesize, it seems a little faster, and its interface is easier. With mpg123, immediately see mpgplay.c - it is only what you need.
With both decoders you can decode the mp3 either completely, or frame by frame. With a few .while loops you can make a buffer, suitable for FFT-512. Iirc, there was some optimisation trick in fft-512, I don't remember where I put its source ^^". Compile mpg123 as static lib in any C/C++ compiler, there are only 3 exported functions, link with your asm code, you'll get a nice 42kB decoder :) . Good luck :alright: (you won't need it :) )
Posted on 2004-05-30 07:46:09 by Ultrano
Try also http://www.mp3-tech.org. They have a list of documentation and decoders with source code. There is a good description of the encoding and decoding process in the document "Design and Implementation of an MPEG/Audio Layer III Bitstream Processor".

I wrote a simple ASM program to decode MP3 to WAV (I posted it on the board). It's buggy and not optimized but maybe you will find it useful. I used the Fraunhofer source code as a reference. It's not optimized but it's easy to follow.
Posted on 2004-05-30 11:16:37 by Dr. Manhattan
Hi,

If you look at my MP3Rates stuff in the Source Code section it gets all of the information from an MP3 audio header. It also calculates the frame size and average bitrate for XING files. It is a fairly simple matter to adapt it so that you can scan frames, ie just jump ahead by the frame size and read the next audio frame header.

http://www.asmcommunity.net/board/index.php?topic=18361

The GetAudioInfo function does what you want.
Posted on 2004-05-30 12:07:10 by donkey
ultrano, manhattan, donkey,

many thabnks for now.

About the Frames Headers, my proggy seems read correctly all the frames.
But If i've understood well, the audio samples decompression is not so easy to do, and normally some library must be used.

Anyway i will like to decode by myself, I will study :) many thanks for all the usefull links :)

B7
Posted on 2004-06-01 06:44:24 by Bit7
Well the decompression is done by a CODEC, usually the Fraunhoffer MP3 codec. Another option is the LAME codec but that is LGPL so there might be some restrictions to it's use. In general if you wish to decode MP3 files directly you should check the licensing requirements from Thomson, MP3 format is both patented and copyright...

http://www.mp3licensing.com/
Posted on 2004-06-01 09:19:08 by donkey