mp3 Format erkennen

Hallo,

ich möchte aus einer mp3-Datei (Extension ist nicht bekannt) das Format erkennen. Bei Bildern (GIF, PNG) habe ich einfach die ersten Bytes aus der Datei ausgelesen und dann nachgeschaut was dort drin steht (z.B. GIF87a oder PNG). Jetzt habe ich mir die mp3 Datei in einem Hex-Editor angeschaut um nach einem Hinweis auf das Dateiformat zu finden. Doch leider ohne Erfolg.

Kann mir jemand sagen, wie ich das Format einer mp3 Datei herausfinde.

Vielen Dank

Ingo

Hallo,

ganz einfach:

fritze@susie:~$ file unbekannt
unbekannt: MP3 file with ID3 version 2.3.0 tag

fritze@susie:~$ man file

**NAME**
 file - determine file type

**SYNOPSIS**
 file [-bcikLnNprsvz] [-f namefile] [-F separator] [ -m magicfiles
 ] file ...
 file -C [-m magicfile]

**DESCRIPTION**
 File tests each argument in an attempt to classify it. There are three
 sets of tests, performed in this order: filesystem tests, magic number
 tests, and language tests. The first test that succeeds causes the
 file type to be printed.

Wenn Du anstelle eines Betriebssystems dieses Zeug aus Redmond einsetzt, dann hilft Dir vielleicht der entsprechende magic-file Eintrag weiter, das „zu Fuß“ und per Hexdump aus der Datei rauszupuhlen:

# MPEG 1.0 Layer 3
0 beshort&0xfffe =0xfffa \bMP3
\>2 byte&0xf0 =0x10 \b, 32 kBits
\>2 byte&0xf0 =0x20 \b, 40 kBits
\>2 byte&0xf0 =0x30 \b, 48 kBits
\>2 byte&0xf0 =0x40 \b, 56 kBits
\>2 byte&0xf0 =0x50 \b, 64 kBits
\>2 byte&0xf0 =0x60 \b, 80 kBits
\>2 byte&0xf0 =0x70 \b, 96 kBits
\>2 byte&0xf0 =0x80 \b, 112 kBits
\>2 byte&0xf0 =0x90 \b, 128 kBits
\>2 byte&0xf0 =0xA0 \b, 160 kBits
\>2 byte&0xf0 =0xB0 \b, 192 kBits
\>2 byte&0xf0 =0xC0 \b, 224 kBits
\>2 byte&0xf0 =0xD0 \b, 256 kBits
\>2 byte&0xf0 =0xE0 \b, 320 kBits

# freq
\>2 byte&0x0C =0x00 \b, 44.1 kHz
\>2 byte&0x0C =0x04 \b, 48 kHz
\>2 byte&0x0C =0x08 \b, 32 kHz

# misc
\>3 byte&0xC0 =0x00 \b, Stereo
\>3 byte&0xC0 =0x40 \b, JStereo
\>3 byte&0xC0 =0x80 \b, Dual-Ch
\>3 byte&0xC0 =0xC0 \b, Mono
#\>1 byte&0x01 =0x00 \b, Error Protection
#\>2 byte&0x02 =0x02 \b, Padding
#\>2 byte&0x01 =0x01 \b, Private
#\>3 byte&0x08 =0x08 \b, Copyright
#\>3 byte&0x04 =0x04 \b, Original
#\>3 byte&0x03 1 \b, Emphasis 5
#\>3 byte&0x03 3 \b, Emphasis c

Viel Spaß

Fritze

Vielen Dank für die Antwort, hat mir sehr geholfen.

Gruß Ingo

[Bei dieser Antwort wurde das Vollzitat nachträglich automatisiert entfernt]