fb:porticula NoPaste
mp3 frame header
Uploader: | Volta |
Datum/Zeit: | 05.05.2009 11:57:14 |
'FF FB 30 CC so stehen die Byts in der mp3 Datei
'&HCC30FBFF so wird es als UINTEGER aus der Datei gelesen
'nach BSWAP &HFFFB30CC
Type mpeg
Emphasis : 2 As UInteger' 0 = keine
' 1 = 50/15 ms
' 2 = reserviert
' 3 = ITU-T J.17
Original : 1 As UInteger' 0 = Kopie
' 1 = Original
Copyright : 1 As UInteger' 0 = ohne Copyright
' 1 = mit Copyright
Mode_Extension : 2 As UInteger' (nur für Joint Stereo)
' gemäß Mode-Extension-Tabelle
Kanalmodus : 2 As UInteger' 0 = Stereo
' 1 = Joint Stereo
' 2 = 2 Mono Kanäle
' 3 = ein Kanal (Mono)
Privat : 1 As UInteger' nur informativ
Padding : 1 As UInteger' 0 = Frame wird nicht aufgefüllt
' 1 = Frame mit Extraslot gefüllt
' Slotgröße: Layer I = 32 Bits; Layer II+III 8 Bits
Samplingfrequenz : 2 As UInteger' gemäß Sampling-Tabelle
Bitrate : 4 As UInteger' gemäß Bitraten-Tabelle
Protection : 1 As UInteger' 0 = 16-Bit CRC nach dem Header
' 1 = keine CRC
Layer : 2 As UInteger' 0 = reserviert
' 1 = Layer III
' 2 = Layer II
' 3 = Layer I
ID : 2 As UInteger' 0 = MPEG Version 2.5
' 1 = reserviert
' 2 = MPEG Version 2
' 3 = MPEG Version 1
Sync : 11 As UInteger' alle Bits sind auf 1 gesetzt
End Type
'nach http://de.wikipedia.org/wiki/MP3
Dim As Integer Bitrate(0 To 79) = {0,0,0,0,0,32,32,32,32,8, _
64,48,40,48,16,96,56,48,56,24,128,64,56,64,32,160,80,64,80,40, _
192,96,80,96,48,224,112,96,112,56,256,128,112,128,64,288,160,128,144,80, _
320,192,160,160,96,352,224,192,176,112,384,256,224,192,128,416,320,256,224,144, _
448,384,320,256,160,0,0,0,0,0}
Dim As Integer Frequency(0 To 15) = {11025,00000,22050,44100,_
12000,00000,24000,48000, 08000,00000,16000,32000, 00000,00000,00000,00000}
Dim As String*3 YN(0 To 1) = {"No ","Yes"}
Dim mp3header As mpeg
Dim As Integer tmp, ff = FreeFile
Open "Drums A Go Go.mp3" For Binary As #ff
If Lof(ff) > 8195 Then
For i As Integer = 1 To 2040
Get #ff,i,tmp
Asm
mov eax, [tmp]
bswap eax
mov [mp3header], eax
End Asm
If mp3header.Sync = &H7ff and mp3header.Bitrate Then
With mp3header
Print "MPEG Audio Version ";
Select Case .ID 'Version
Case 0
Print "2.5"
Case 1
Print "???"
Case 2
Print "2.0"
Case 3
Print "1.0"
End Select
tmp=0
Print "Layer ";
Select Case .Layer 'Layer
Case 0
Print "???"
Case 1
Print "III"
IF .ID = 3 THEN tmp = 3 Else tmp = 5
Case 2
Print "II"
IF .ID = 3 THEN tmp = 2 Else tmp = 5
Case 3
Print "I"
IF .ID = 3 THEN tmp = 1 Else tmp = 4
END Select
Print "Protection ";YN(.Protection)
Print "Bitrate ";Bitrate(.Bitrate*5 +tmp);" KBit"
Print "Samplingfrequenz ";Frequency(.Samplingfrequenz +.ID);" Hz"
Print "Padding ";YN(.Padding)
Print "Privat ";YN(.Privat)
Select Case .Kanalmodus
Case 0
Print "Stereo"
Case 1
Print "Joint Stereo"
Case 2
Print "Dual Channel"
Case 3
Print "Mono"
End Select
'Print .Mode_Extension
Print "Copyright ";YN(.Copyright)
Print "Original ";YN(.Original)
Print "Emphasis ";
Select Case .Emphasis
Case 0
Print "None"
Case 1
Print "50/15 ms"
Case 2
Print "???"
Case 3
Print "CIT J.17"
End Select
End With
Exit For
EndIf
Next
EndIf
Close #ff
Sleep