Groups > Borland > Borland Delphi multimedia > Re: (MP3) MPG Layer 3 compression




(MP3) MPG Layer 3 compression

(MP3) MPG Layer 3 compression
Wed, 15 Aug 2007 11:20:46 -030
De: "Alexandre Palomo" <alexandre@digifort.com.br>
Assunto: (MP3) MPG Layer 3 compression
Data: quarta-feira, 15 de agosto de 2007 11:00

I'm working with audio files and I got a problem.

When I compressed a PCM file into a MP3, $C#0#1#0#2#0#0#0#$90#0#1#0'q'#5'
has been added to the file's header, but I don't know what is the meaning of
these bytes.

Could somebody help me with this?



complete file header:

'RIFF>'#0#0#0'WAVEfmt
'#$1E#0#0#0'U'#0#2#0'À]'#0#0'p'#$17#0#0#1#0#0#0#$C#0#1#0#2#0#0#0#$90#0#1#0'q'#5'
fact'#4#0#0#0#0#0#0#0'data'#0#0#0#0


Post Reply
Re: (MP3) MPG Layer 3 compression
Wed, 15 Aug 2007 20:06:07 +030
"Alex" wrote
> I'm working with audio files and I got a problem.
>
> When I compressed a PCM file into a MP3, 
> $C#0#1#0#2#0#0#0#$90#0#1#0'q'#5'
> has been added to the file's header, but I don't know what is the 
> meaning of
> these bytes.
>
> Could somebody help me with this?

Its an extension to the 'fmt ' chunk.
The purpose is to provide the player with necessary information about 
compression and is used only if compression is something else than 
PCM.
I have seen various break downs of the WAV format and some suggests 
that this extension should be a minimum of 22 bytes. In your example 
it is only 12 bytes. What is the program with which you created the 
file?
The definitions I have seen says that the extension would consist of
2 bytes valid bits per sample
4 bytes channel mask (speaker positioning)
16 bytes GUID (possibly referring to codec)

> complete file header:
>
> 'RIFF>'#0#0#0'WAVEfmt
>
'#$1E#0#0#0'U'#0#2#0'À]'#0#0'p'#$17#0#0#1#0#0#0#$C#0#1#0#2#0#0#0#$90#0#1#0'q'#5'
fact'#4#0#0#0#0#0#0#0'data'#0#0#0#0
>
Here's a breakdown as I understand it ( I converted some of the #$xx 
codes to decimal and some of the characters to their decimal 
representation for readability):
RIFF
#62#0#0#0 size of riff data
WAVE
'fmt '
#30#0#0#0 size of 'fmt ' chunk
#85#0 compression code = mp3
#2#0 number of channels = 2
'À]'#0#0 sample rate = ?? Hex or decimal codes for the first two bytes 
?
#112#23#0#0 average bytes per second = 6000
#1#0 block align = 1 byte
#0#0 significant bits per sample = 0 can it be 0 ?
#12#0 size of extra format bytes = 12
#1#0 valid bits per sample = 1 ?
#2#0#0#0 channel mask (speaker position) = 2
#144#0#1#0#113#5 ???? Wonder if this is valid ?
'fact'
#4#0#0#0 size of 'fact' chunk
#0#0#0#0
'data'
#0#0#0#0 size of 'data' chunk


Best regards
Descartes

Post Reply
about | contact