Log in

View Full Version : A Question of Variability



gopher_yarrowzoo
08-08-2007, 02:14 AM
okay I'm trying to write a parser for mp3 v2 tags but since all the tags have different data formats (okay so some are similar so I could use a switch statement but I don't wanna huge one :P), I was wondering if say I had all the expected tag types in an array in say a specific format
i.e array(X => array('TRK','TRCK','#N'), .... where X is a ' ' enclosed number and the last column is the format using a customised format code as obviously trying to put exactly what's expected would be hard as some start ($01/$02) to define the encoding - normal / unicode, others are variable length numbers, character fields, $00 dividers etc. So I came up with a way of doing that now how do I get this to parse properly..

$ = $01/$02, # = $00 [$00] depending on $ is 01 or 02, ! = $00 always - divider
A = Alphanumerical (NN)(RM)(CR) - special format, B = Binary Data, C = General Text String, D = DDMM,
E = 3 char currency code, F = Float Number, G = 3 char field, K = [ABCDEFGb#o]only., M = MMDD,
N = Int Number, Q = unknown mutli-bit digit, T = HHMM, U = URL String, V = 1-byte digit,
W = 2-byte digit, X = 3-byte digit, Y = YYYY, Z = 4-byte digit / etc - divisor,
[] possibly repeated section.
Example:
'62' => array('','COMR','$EF[/EF]!YMU!VC#C#[C!B]') - Commercial frame

I'd obviously have to define a few arrays at the start to define valid currency Language codes and somethings are "variable" in length depending on previous parts of the string, but they do appear in a same order.
Any ideas would be useful. I mean I did manage to get the thing to read VBR files and get the song time correct :) So this shouldn't be too hard just trying to get my head around it.
Im thinking of seeing if I can't make this once it all works a stand-alone application that can scan your drive and drag all your mp3 info out and store it in a DB with a "click" to play ability ;).

LAURENU2
08-08-2007, 08:53 AM
Ipod

em99010pepe
08-08-2007, 11:32 AM
Ipod

:lmao:

LAURENU2
08-08-2007, 01:25 PM
:lmao:
:umm: Your right forgot to convert it in to a script:bang:
%I""p^o>d$$ =--->>:rotfl:

gopher_yarrowzoo
08-09-2007, 06:25 PM
.......
GLARES at you both! an IPod is a standalone device not a standalone application but I can see I might not get any help on this so :P

LAURENU2
08-09-2007, 06:45 PM
.......
GLARES at you both! an IPod is a standalone device not a standalone application but I can see I might not get any help on this so :P
I thought that was prety good for a Dumb plumber:lmao:
Well it was the best I could do

em99010pepe
08-09-2007, 06:56 PM
Peace. :sofa:

Helix_Von_Smelix
08-09-2007, 06:58 PM
:lmao: :lmao: :Pokes: :Pokes:

:clap: :clap: :clap: :clap: :clap:

gopher_yarrowzoo
08-10-2007, 02:00 AM
I thought that was prety good for a Dumb plumber:lmao:
Well it was the best I could do
Dumb Plumber where...... I don't see no dumb plumber :p


Peace. :sofa:

*growls* :rotfl: :rotfl: :rotfl: :cheers:

HvS .... :Pokes: :Pokes: :Pokes: :Pokes: :Pokes: :Pokes: :haddock: