-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmp3.grammar
2712 lines (2623 loc) · 211 KB
/
mp3.grammar
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<ufwb version="1.17">
<grammar name="MP3" start="id:1999" author="Andreas Pehnack" email="[email protected]" fileextension="mp3" uti="public.mp3">
<description>Grammar for MP3 files</description>
<structure name="MP3 file" id="1999" encoding="ISO_8859-1:1987" endian="big" signed="no">
<structure name="ID3" id="2000" repeatmin="0" order="variable">
<structref name="ID3V2.0" id="2002" repeatmin="0" structure="id:2001"/>
<structref name="ID3v2.3" id="2004" repeatmin="0" structure="id:2003"/>
</structure>
<structure name="Frames" id="2006" repeatmax="-1" order="variable">
<structref name="Frame" id="2008" repeatmin="0" structure="id:2007"/>
<structref name="ID3v1" id="2010" repeatmin="0" structure="id:2009"/>
<number name="Padding" id="2011" repeatmin="0" type="integer" length="1"/>
</structure>
</structure>
<structure name="MPEG Audio Frame Frame" id="2007" encoding="ISO_8859-1:1987" endian="big" signed="no">
<number name="Frame sync" mustmatch="yes" id="2014" fillcolor="FF2F92" type="integer" length="11" lengthunit="bit" display="hex">
<fixedvalues>
<fixedvalue name="SYNC" value="0x7FF"/>
</fixedvalues>
</number>
<number name="MPEG Audio version ID" id="2015" type="integer" length="2" lengthunit="bit">
<fixedvalues>
<fixedvalue name="MPEG Version 2.5" value="0"/>
<fixedvalue name="reserved" value="1"/>
<fixedvalue name="MPEG Version 2 (ISO/IEC 13818-3)" value="2"/>
<fixedvalue name="MPEG Version 1 (ISO/IEC 11172-3)" value="3"/>
</fixedvalues>
</number>
<number name="Layer description" id="2016" type="integer" length="2" lengthunit="bit">
<fixedvalues>
<fixedvalue name="reserved" value="0"/>
<fixedvalue name="Layer III" value="1"/>
<fixedvalue name="Layer II" value="2"/>
<fixedvalue name="Layer I" value="3"/>
</fixedvalues>
</number>
<number name="Protection bit" id="2017" type="integer" length="1" lengthunit="bit">
<fixedvalues>
<fixedvalue name="Protected by CRC" value="0"/>
<fixedvalue name="Not protected" value="1"/>
</fixedvalues>
</number>
<number name="Bitrate index" id="2018" type="integer" length="4" lengthunit="bit"/>
<scriptelement name="Bitrate" id="2019">
<script name="unnamed" type="Generic">
<source language="Python">rows = 16
columns = 5
bitrateMatrix = [[0 for x in range(columns)] for y in range(rows)]
# First row
for i in range(columns):
bitrateMatrix[0][i] = "free"
# Last row
for i in range(columns):
bitrateMatrix[rows-1][i] = "bad"
bitrateMatrix[1] = "32,32,32,32,8".split(",")
bitrateMatrix[2] = "64,48,40,48,16".split(",")
bitrateMatrix[3] = "96,56,48,56,24".split(",")
bitrateMatrix[4] = "128,64,56,64,32".split(",")
bitrateMatrix[5] = "160,80,64,80,40".split(",")
bitrateMatrix[6] = "192,96,80,96,48".split(",")
bitrateMatrix[7] = "224,112,96,112,56".split(",")
bitrateMatrix[8] = "256,128,112,128,64".split(",")
bitrateMatrix[9] = "288,160,128,144,80".split(",")
bitrateMatrix[10] = "320,192,160,160,96".split(",")
bitrateMatrix[11] = "352,224,192,176,112".split(",")
bitrateMatrix[12] = "384,256,224,192,128".split(",")
bitrateMatrix[13] = "416,320,256,224,144".split(",")
bitrateMatrix[14] = "448,384,320,256,160".split(",")
# get collection with results so far
results = currentMapper.getCurrentResults()
# get bitrate index
lastResult = results.getLastResult()
versionIdResult = results.getResultByName("MPEG Audio version ID")
layerResult = results.getResultByName("Layer description")
# access the parsed values
bitrateIndexValue = lastResult.getValue()
versionIdValue = versionIdResult.getValue()
layerValue = layerResult.getValue()
# get the value parsed
bitrateIndex = bitrateIndexValue.getUnsignedNumber()
version = versionIdValue.getUnsignedNumber()
layer = layerValue.getUnsignedNumber()
column = 0
if (version == 3):
if (layer == 3):
column = 0
elif (layer == 2):
column = 1
elif (layer == 1):
column = 2
elif (version == 2):
if (layer == 3):
column = 3
else:
column = 4
bitrate = bitrateMatrix[bitrateIndex][column] + " kbit"
value = Value()
value.setString(bitrate)
# element = currentMapper.getCurrentElement()
element = Element(ELEMENT_STRING, "Bitrate", True)
# add element with value to results
results.addElement(element, 0, 0, value)
</source>
</script>
</scriptelement>
<number name="Sampling rate frequency index" id="2020" fillcolor="72FCD5" type="integer" length="2" lengthunit="bit"/>
<scriptelement name="Sampling rate" id="2021">
<script name="unnamed" type="Generic">
<source language="Python">rows = 4
columns = 3
samplingRateMatrix = [[0 for x in range(columns)] for y in range(rows)]
samplingRateMatrix[0] = "44100,22050,11025".split(",")
samplingRateMatrix[1] = "48000,24000,12000".split(",")
samplingRateMatrix[2] = "32000,16000,8000".split(",")
samplingRateMatrix[3] = "reserv.,reserv.,reserv.".split(",")
# get collection with results so far
results = currentMapper.getCurrentResults()
# get sampling rate index
lastResult = results.getLastResult()
versionIdResult = results.getResultByName("MPEG Audio version ID")
# access the parsed values
samplingRateIndexValue = lastResult.getValue()
versionIdValue = versionIdResult.getValue()
# get the value parsed
samplingRateIndex = samplingRateIndexValue.getUnsignedNumber()
version = versionIdValue.getUnsignedNumber()
column = 0
if (version == 3):
column = 0
elif (version == 2):
column = 1
else:
column = 2
samplingRate = samplingRateMatrix[samplingRateIndex][column] + " Hz"
print(samplingRate)
value = Value()
value.setString(samplingRate)
# element = currentMapper.getCurrentElement()
element = Element(ELEMENT_STRING, "Sampling rate", True)
# add element with value to results
results.addElement(element, 0, 0, value)
</source>
</script>
</scriptelement>
<number name="Padding bit" id="2022" type="integer" length="1" lengthunit="bit"/>
<number name="Private bit" id="2023" type="integer" length="1" lengthunit="bit"/>
<number name="Channel Mode" id="2024" type="integer" length="2" lengthunit="bit">
<fixedvalues>
<fixedvalue name="Stereo" value="0"/>
<fixedvalue name="Joint Stereo" value="1"/>
<fixedvalue name="Dual channel (Stereo)" value="2"/>
<fixedvalue name="Single channel (Mono)" value="3"/>
</fixedvalues>
</number>
<number name="Mode extension" id="2025" type="integer" length="2" lengthunit="bit"/>
<number name="Copyright" id="2026" fillcolor="FF7D78" type="integer" length="1" lengthunit="bit">
<fixedvalues>
<fixedvalue name="Audio is not copyrighted" value="0"/>
<fixedvalue name="Audio is copyrighted" value="1"/>
</fixedvalues>
</number>
<number name="Original" id="2027" type="integer" length="1" lengthunit="bit">
<fixedvalues>
<fixedvalue name="Copy of original media" value="0"/>
<fixedvalue name="Original media" value="1"/>
</fixedvalues>
</number>
<number name="Emphasis" id="2028" type="integer" length="2" lengthunit="bit">
<fixedvalues>
<fixedvalue name="none" value="0"/>
<fixedvalue name="50/15 ms" value="1"/>
<fixedvalue name="reserved" value="2"/>
<fixedvalue name="CCIT J.17" value="3"/>
</fixedvalues>
</number>
<scriptelement name="ParseCRC" id="2029">
<script name="unnamed" type="Generic">
<source language="Python"># get collection with results so far
results = currentMapper.getCurrentResults()
# get protection bit
protectionBitResult = results.getResultByName("Protection bit")
# access the parsed values
protectionBitValue = protectionBitResult.getValue()
# get the value parsed
protectionBit = protectionBitValue.getUnsignedNumber()
if (protectionBit == 0):
element = Element(ELEMENT_NUMBER, "CRC", True)
element.setLength("2", LENGTH_UNIT_BYTES)
element.setNumberDisplayType(NUMBER_DISPLAY_HEX)
currentMapper.mapElementWithSize(element, 2)
</source>
</script>
</scriptelement>
<scriptelement name="Length" id="2030">
<script name="unnamed" type="Generic">
<source language="Python"># get collection with results so far
results = currentMapper.getCurrentResults()
# get bitrate index
bitrateResult = results.getResultByName("Bitrate")
samplingRateResult = results.getResultByName("Sampling rate")
layerResult = results.getResultByName("Layer description")
paddingResult = results.getResultByName("Padding bit")
# access the parsed values
bitrateValue = bitrateResult.getValue()
samplingRateValue = samplingRateResult.getValue()
layerValue = layerResult.getValue()
paddingValue = paddingResult.getValue()
# get the value parsed
bitrate = bitrateValue.getUnsignedNumber() * 1000
samplingRate = samplingRateValue.getUnsignedNumber()
layer = layerValue.getUnsignedNumber()
paddingBit = paddingValue.getUnsignedNumber()
if (samplingRate < 1):
print("Sampling rate is negative")
frameLengthInBytes = 0
padding = 0
if (layer == 3):
if (paddingBit == 1):
padding = 4
frameLengthInBytes = (12 * bitrate // samplingRate + padding) * 4 - 4
else:
if (paddingBit == 1):
padding = 1
frameLengthInBytes = 144 * bitrate // samplingRate + padding - 4
if (frameLengthInBytes < 0):
print("Frame length not positive")
value = Value()
value.setUnsigned(frameLengthInBytes)
element = Element(ELEMENT_NUMBER, "Length", True)
# add element with value to results
results.addElement(element, 0, 0, value)
</source>
</script>
</scriptelement>
<binary name="FrameData" id="2031" fillcolor="72FA78" length="Length"/>
</structure>
<structure name="ID3v1" id="2009" encoding="ISO_8859-1:1987" endian="big" signed="no">
<string name="Identifier" mustmatch="yes" id="2033" fillcolor="FF40FF" type="fixed-length" length="3">
<fixedvalues>
<fixedvalue name="TAG" value="TAG"/>
</fixedvalues>
</string>
<string name="Title" id="2034" fillcolor="FF7D78" type="fixed-length" length="30"/>
<string name="Artist" id="2035" fillcolor="FF89D8" type="fixed-length" length="30"/>
<string name="Album" id="2036" fillcolor="75D5FF" type="fixed-length" length="30"/>
<string name="Year" id="3994" fillcolor="FEFC78" type="fixed-length" length="4"/>
<string name="Comment" id="2038" fillcolor="73FDFF" type="fixed-length" length="30"/>
<number name="Genre" id="2039" fillcolor="7980FF" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Blues" value="0"/>
<fixedvalue name="Classic Rock" value="1"/>
<fixedvalue name="Country" value="2"/>
<fixedvalue name="Dance" value="3"/>
<fixedvalue name="Disco" value="4"/>
<fixedvalue name="Func" value="5"/>
<fixedvalue name="Grunge" value="6"/>
<fixedvalue name="Hip-Hop" value="7"/>
<fixedvalue name="Jazz" value="8"/>
<fixedvalue name="Metal" value="9"/>
<fixedvalue name="New Age" value="10"/>
<fixedvalue name="Oldies" value="11"/>
<fixedvalue name="Other" value="12"/>
<fixedvalue name="Pop" value="13"/>
<fixedvalue name="R&B" value="14"/>
<fixedvalue name="Rap" value="15"/>
<fixedvalue name="Reggae" value="16"/>
<fixedvalue name="Rock" value="17"/>
<fixedvalue name="Techno" value="18"/>
<fixedvalue name="Industrial" value="19"/>
<fixedvalue name="Alternative" value="20"/>
<fixedvalue name="Ska" value="21"/>
<fixedvalue name="Death Metal" value="22"/>
<fixedvalue name="Pranks" value="23"/>
<fixedvalue name="Soundtrack" value="24"/>
<fixedvalue name="Euro-Techno" value="25"/>
<fixedvalue name="Ambient" value="26"/>
<fixedvalue name="Trip-Hop" value="27"/>
<fixedvalue name="Vocal" value="28"/>
<fixedvalue name="Jazz+Funk" value="29"/>
<fixedvalue name="Fusion" value="30"/>
<fixedvalue name="Trance" value="31"/>
<fixedvalue name="Classical" value="32"/>
<fixedvalue name="Instrumental" value="33"/>
<fixedvalue name="Acid" value="34"/>
<fixedvalue name="House" value="35"/>
<fixedvalue name="Game" value="36"/>
<fixedvalue name="Sound Clip" value="37"/>
<fixedvalue name="Gospel" value="38"/>
<fixedvalue name="Noise" value="39"/>
<fixedvalue name="AlternRock" value="40"/>
<fixedvalue name="Bass" value="41"/>
<fixedvalue name="Soul" value="42"/>
<fixedvalue name="Punk" value="43"/>
<fixedvalue name="Space" value="44"/>
<fixedvalue name="Meditative" value="45"/>
<fixedvalue name="Instrumental Pop" value="46"/>
<fixedvalue name="Instrumental Rock" value="47"/>
<fixedvalue name="Ethnic" value="48"/>
<fixedvalue name="Gothic" value="49"/>
<fixedvalue name="Darkwave" value="50"/>
<fixedvalue name="Techno-Industrial" value="51"/>
<fixedvalue name="Electronic" value="52"/>
<fixedvalue name="Pop-Folk" value="53"/>
<fixedvalue name="Eurodance" value="54"/>
<fixedvalue name="Dream" value="55"/>
<fixedvalue name="Southern Rock" value="56"/>
<fixedvalue name="Comedy" value="57"/>
<fixedvalue name="Cult" value="58"/>
<fixedvalue name="Gangsta" value="59"/>
<fixedvalue name="Top 40" value="60"/>
<fixedvalue name="Christian Rap" value="61"/>
<fixedvalue name="Pop/Funk" value="62"/>
<fixedvalue name="Jungle" value="63"/>
<fixedvalue name="Native American" value="64"/>
<fixedvalue name="Cabaret" value="65"/>
<fixedvalue name="New Wave" value="66"/>
<fixedvalue name="Psychadelic" value="67"/>
<fixedvalue name="Rave" value="68"/>
<fixedvalue name="Showtunes" value="69"/>
<fixedvalue name="Trailer" value="70"/>
<fixedvalue name="LoFi" value="71"/>
<fixedvalue name="Tribal" value="72"/>
<fixedvalue name="Acid Punk" value="73"/>
<fixedvalue name="Acid Jazz" value="74"/>
<fixedvalue name="Polka" value="75"/>
<fixedvalue name="Retro" value="76"/>
<fixedvalue name="Musical" value="77"/>
<fixedvalue name="Rock & Roll" value="78"/>
<fixedvalue name="Hard Rock" value="79"/>
<fixedvalue name="Folk" value="80"/>
<fixedvalue name="Folk-Rock" value="81"/>
<fixedvalue name="National Folk" value="82"/>
<fixedvalue name="Swing" value="83"/>
<fixedvalue name="Fast Fusion" value="84"/>
<fixedvalue name="Bebob" value="85"/>
<fixedvalue name="Latin" value="86"/>
<fixedvalue name="Revival" value="87"/>
<fixedvalue name="Celtic" value="88"/>
<fixedvalue name="Bluegrass" value="89"/>
<fixedvalue name="Avantgarde" value="90"/>
<fixedvalue name="Gothic Rock" value="91"/>
<fixedvalue name="Progressive Rock" value="92"/>
<fixedvalue name="Psychedelic Rock" value="93"/>
<fixedvalue name="Symphonic Rock" value="94"/>
<fixedvalue name="Slow Rock" value="95"/>
<fixedvalue name="Big Band" value="96"/>
<fixedvalue name="Chorus" value="97"/>
<fixedvalue name="Easy Listening" value="98"/>
<fixedvalue name="Acoustic" value="99"/>
<fixedvalue name="Humour" value="100"/>
<fixedvalue name="Speech" value="101"/>
<fixedvalue name="Chanson" value="102"/>
<fixedvalue name="Opera" value="103"/>
<fixedvalue name="Chamber Music" value="104"/>
<fixedvalue name="Sonata" value="105"/>
<fixedvalue name="Symphony" value="106"/>
<fixedvalue name="Booty Brass" value="107"/>
<fixedvalue name="Primus" value="108"/>
<fixedvalue name="Porn Groove" value="109"/>
<fixedvalue name="Satire" value="110"/>
<fixedvalue name="Slow Jam" value="111"/>
<fixedvalue name="Club" value="112"/>
<fixedvalue name="Tango" value="113"/>
<fixedvalue name="Samba" value="114"/>
<fixedvalue name="Folklore" value="115"/>
<fixedvalue name="Ballad" value="116"/>
<fixedvalue name="Power Ballad" value="117"/>
<fixedvalue name="Rhythmic Soul" value="118"/>
<fixedvalue name="Freestyle" value="119"/>
<fixedvalue name="Duet" value="120"/>
<fixedvalue name="Punk Rock" value="121"/>
<fixedvalue name="Drum Solo" value="122"/>
<fixedvalue name="A Capela" value="123"/>
<fixedvalue name="Euro-House" value="124"/>
<fixedvalue name="Dance Hall" value="125"/>
</fixedvalues>
</number>
</structure>
<structure name="ID3v2" id="2041" encoding="ISO_8859-1:1987" endian="big" signed="no">
<string name="Identifier" mustmatch="yes" id="2042" type="fixed-length" length="3">
<fixedvalues>
<fixedvalue name="ID3" value="ID3"/>
</fixedvalues>
</string>
<number name="Major version" mustmatch="yes" id="2043" type="integer" length="1"/>
<number name="Minor version" mustmatch="yes" id="2044" type="integer" length="1"/>
</structure>
<structure name="ID3V2.0" id="2001" length="0" extends="id:2041">
<number name="Major version" id="2047" type="integer">
<fixedvalues>
<fixedvalue name="2" value="2"/>
</fixedvalues>
</number>
<number name="Minor version" id="2048" type="integer">
<fixedvalues>
<fixedvalue name="0" value="0"/>
</fixedvalues>
</number>
<number name="Unsynchronisation" id="2049" type="integer" length="1" lengthunit="bit"/>
<number name="Compression" id="2050" type="integer" length="1" lengthunit="bit"/>
<number name="OtherFlags" id="2051" type="integer" length="6" lengthunit="bit"/>
<number name="RawSize" id="2052" type="integer" length="32" lengthunit="bit"/>
<scriptelement name="Size" id="2053">
<script name="unnamed" type="Generic">
<source language="Python">size = 4
# get collection with results so far
results = currentMapper.getCurrentResults()
lastResult = results.getLastResult()
# access the parsed value
value = lastResult.getValue()
# get the value parsed
number = value.getUnsignedNumber()
decodedNumber = (number & 0x7F) + ((number & 0x7F00) >> 1) + ((number & 0x7F0000) >> 2) + ((number & 0x7F000000) >> 3)
print(number)
print(decodedNumber)
value = Value()
value.setUnsigned(decodedNumber)
# element = currentMapper.getCurrentElement()
element = Element(ELEMENT_NUMBER, "Size", True)
# add element with value to results
results.addElement(element, size, 0, value)
</source>
</script>
</scriptelement>
<structure name="Frames" id="2054" length="Size">
<structure name="Switch" id="2055" repeatmax="-1" order="variable">
<structref name="BUF Frame - Recommended buffer size" id="2057" repeatmin="0" structure="id:2056"/>
<structref name="CNT Frame - Play counter" id="2059" repeatmin="0" structure="id:2058"/>
<structref name="COM Frame - Comments" id="2061" repeatmin="0" structure="id:2060"/>
<structref name="CRA Frame - Audio encryption" id="2063" repeatmin="0" structure="id:2062"/>
<structref name="CRM Frame - Encrypted meta frame" id="2065" repeatmin="0" structure="id:2064"/>
<structref name="ETC Frame - Event timing codes" id="2067" repeatmin="0" structure="id:2066"/>
<structref name="EQU Frame - Equalisation" id="2069" repeatmin="0" structure="id:2068"/>
<structref name="GEO Frame - General encapsulated object" id="2071" repeatmin="0" structure="id:2070"/>
<structref name="IPL Frame - Involved people list" id="2073" repeatmin="0" structure="id:2072"/>
<structref name="LNK Frame - Linked information" id="2075" repeatmin="0" structure="id:2074"/>
<structref name="MCI Frame - Music CD Identifier" id="2077" repeatmin="0" structure="id:2076"/>
<structref name="MLL Frame - MPEG location lookup table" id="2079" repeatmin="0" structure="id:2078"/>
<structref name="PIC Frame - Attached picture" id="2081" repeatmin="0" structure="id:2080"/>
<structref name="POP Frame - Popularimeter" id="2083" repeatmin="0" structure="id:2082"/>
<structref name="REV Frame - Reverb" id="2085" repeatmin="0" structure="id:2084"/>
<structref name="RVA Frame - Relative volume adjustment" id="2087" repeatmin="0" structure="id:2086"/>
<structref name="SLT Frame - Synchronised lyrics/text" id="2089" repeatmin="0" structure="id:2088"/>
<structref name="STC Frame - Synced tempo codes" id="2091" repeatmin="0" structure="id:2090"/>
<structref name="TAL Frame - Album/Movie/Show title" id="2093" repeatmin="0" structure="id:2092"/>
<structref name="TBP Frame - BPM (Beats Per Minute)" id="2095" repeatmin="0" structure="id:2094"/>
<structref name="TCM Frame - Composer(s)" id="2097" repeatmin="0" structure="id:2096"/>
<structref name="TCO Frame - Content type" id="2099" repeatmin="0" structure="id:2098"/>
<structref name="TCR Frame - Copyright message" id="2101" repeatmin="0" structure="id:2100"/>
<structref name="TDA Frame - Date" id="2103" repeatmin="0" structure="id:2102"/>
<structref name="TDY Frame - Playlist delay" id="2105" repeatmin="0" structure="id:2104"/>
<structref name="TEN Frame - Encoded by" id="2107" repeatmin="0" structure="id:2106"/>
<structref name="TFT Frame - File type" id="2109" repeatmin="0" structure="id:2108"/>
<structref name="TIM Frame - Time" id="2111" repeatmin="0" structure="id:2110"/>
<structref name="TKE Frame - Initial key" id="2113" repeatmin="0" structure="id:2112"/>
<structref name="TLA Frame - Language(s)" id="2115" repeatmin="0" structure="id:2114"/>
<structref name="TLE Frame - Length" id="2117" repeatmin="0" structure="id:2116"/>
<structref name="TMT Frame - Media type" id="2119" repeatmin="0" structure="id:2118"/>
<structref name="TOA Frame - Original artist(s)/performer(s)" id="2121" repeatmin="0" structure="id:2120"/>
<structref name="TOF Frame - Original filename" id="2123" repeatmin="0" structure="id:2122"/>
<structref name="TOL Frame - Original Lyricist(s)/text writer(s)" id="2125" repeatmin="0" structure="id:2124"/>
<structref name="TOR Frame - Original release year" id="2127" repeatmin="0" structure="id:2126"/>
<structref name="TOT Frame - Original album/Movie/Show title" id="2129" repeatmin="0" structure="id:2128"/>
<structref name="TP1 Frame - Lead artist(s)/Lead performer(s)/Soloist(s)/Performing group" id="2131" repeatmin="0" structure="id:2130"/>
<structref name="TP2 Frame - Band/Orchestra/Accompaniment" id="2133" repeatmin="0" structure="id:2132"/>
<structref name="TP3 Frame - Conductor" id="2135" repeatmin="0" structure="id:2134"/>
<structref name="TP4 Frame - Interpreted, remixed, or otherwise modified by" id="2137" repeatmin="0" structure="id:2136"/>
<structref name="TPA Frame - Part of a set" id="2139" repeatmin="0" structure="id:2138"/>
<structref name="TPB Frame - Publisher" id="2141" repeatmin="0" structure="id:2140"/>
<structref name="TRC Frame - ISRC (International Standard Recording Code)" id="2143" repeatmin="0" structure="id:2142"/>
<structref name="TRD Frame - Recording dates" id="2145" repeatmin="0" structure="id:2144"/>
<structref name="TRK Frame - Track number/Position in set" id="2147" repeatmin="0" structure="id:2146"/>
<structref name="TSA Frame - Album Sort" id="2149" repeatmin="0" structure="id:2148"/>
<structref name="TS2 Frame - Album Artist Sort" id="2151" repeatmin="0" structure="id:2150"/>
<structref name="TSC Frame - Composer Sort" id="2153" repeatmin="0" structure="id:2152"/>
<structref name="TSI Frame - Size" id="2155" repeatmin="0" structure="id:2154"/>
<structref name="TSP Frame - Artist Sort" id="2157" repeatmin="0" structure="id:2156"/>
<structref name="TSS Frame - Software/hardware and settings used for encoding" id="2159" repeatmin="0" structure="id:2158"/>
<structref name="TST Frame - Title Sort" id="2161" repeatmin="0" structure="id:2160"/>
<structref name="TT1 Frame - Content group description" id="2163" repeatmin="0" structure="id:2162"/>
<structref name="TT2 Frame - Title/Songname/Content description" id="2165" repeatmin="0" structure="id:2164"/>
<structref name="TT3 Frame - Subtitle/Description refinement" id="2167" repeatmin="0" structure="id:2166"/>
<structref name="TXT Frame - Lyricist(s)/text writer(s)" id="2169" repeatmin="0" structure="id:2168"/>
<structref name="TXX Frame - User defined text information frame" id="2171" repeatmin="0" structure="id:2170"/>
<structref name="TYE Frame - Year" id="2173" repeatmin="0" structure="id:2172"/>
<structref name="UFI Frame - Unique file identifier" id="2175" repeatmin="0" structure="id:2174"/>
<structref name="ULT Frame - Unsychronised lyrics/text transcription" id="2177" repeatmin="0" structure="id:2176"/>
<structref name="ULT Frame - Unsychronised lyrics/text transcription-1" id="2178" repeatmin="0" structure="id:2176"/>
<structref name="ID3v2.0 Frame" id="2180" structure="id:2179"/>
</structure>
</structure>
</structure>
<structure name="ID3v2.3" id="2003" length="0" extends="id:2041" encoding="ISO_8859-1:1987" endian="big" signed="no">
<number name="Major version" id="2185" type="integer">
<fixedvalues>
<fixedvalue name="3" value="3"/>
</fixedvalues>
</number>
<number name="Minor version" id="2186" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Version 0" value="0"/>
</fixedvalues>
</number>
<number name="Unsynchronisation" id="2187" type="integer" length="1" lengthunit="bit"/>
<number name="ExtendedHeader" id="2188" type="integer" length="1" lengthunit="bit"/>
<number name="Experimental indicator" id="2189" type="integer" length="1" lengthunit="bit"/>
<number name="Unused" id="2190" type="integer" length="5" lengthunit="bit"/>
<number name="RawSize" id="2191" type="integer" length="4" display="hex"/>
<scriptelement name="Size" id="2192">
<script name="unnamed" type="Generic">
<source language="Python">size = 4
# get collection with results so far
results = currentMapper.getCurrentResults()
lastResult = results.getLastResult()
# access the parsed value
value = lastResult.getValue()
# get the value parsed
number = value.getUnsignedNumber()
decodedNumber = (number & 0x7F) + ((number & 0x7F00) >> 1) + ((number & 0x7F0000) >> 2) + ((number & 0x7F000000) >> 3)
print(number)
print(decodedNumber)
value = Value()
value.setUnsigned(decodedNumber)
# element = currentMapper.getCurrentElement()
element = Element(ELEMENT_NUMBER, "Size", True)
# add element with value to results
results.addElement(element, size, 0, value)
</source>
</script>
</scriptelement>
<structure name="Frames" id="2193" length="Size">
<structure name="Switch" id="2194" length="0" repeatmax="-1" order="variable">
<structref name="AENC Frame - Audio encryption" id="2196" repeatmin="0" structure="id:2195"/>
<structref name="APIC Frame" id="2198" repeatmin="0" structure="id:2197"/>
<structref name="ASPI Frame - Audio seek point index" id="2200" repeatmin="0" structure="id:2199"/>
<structref name="COMM Frame - Comments" id="2202" repeatmin="0" structure="id:2201"/>
<structref name="COMR Frame - Commercial frame" id="2204" repeatmin="0" structure="id:2203"/>
<structref name="ENCR Frame - Encryption method registration" id="2206" repeatmin="0" structure="id:2205"/>
<structref name="EQUA Frame - Equalization" id="2208" repeatmin="0" structure="id:2207"/>
<structref name="EQU2 Frame - Equalisation (2)" id="2210" repeatmin="0" structure="id:2209"/>
<structref name="ETCO Frame - Event timing codes" id="2212" repeatmin="0" structure="id:2211"/>
<structref name="GEOB Frame - General encapsulated object" id="2214" repeatmin="0" structure="id:2213"/>
<structref name="GRID Frame - Group identification registration" id="2216" repeatmin="0" structure="id:2215"/>
<structref name="IPLS Frame - Involved people list" id="2218" repeatmin="0" structure="id:2217"/>
<structref name="LINK Frame - Linked information" id="2220" repeatmin="0" structure="id:2219"/>
<structref name="MLLT Frame - MPEG location lookup table" id="2222" repeatmin="0" structure="id:2221"/>
<structref name="OWNE Frame - Ownership frame" id="2224" repeatmin="0" structure="id:2223"/>
<structref name="PRIV Frame - Ownership frame" id="2226" repeatmin="0" structure="id:2225"/>
<structref name="PCNT Frame - Play counter" id="2228" repeatmin="0" structure="id:2227"/>
<structref name="POPM Frame - Popularimeter" id="2230" repeatmin="0" structure="id:2229"/>
<structref name="POSS Frame - Position synchronisation frame" id="2232" repeatmin="0" structure="id:2231"/>
<structref name="RBUF Frame - Recommended buffer size" id="2234" repeatmin="0" structure="id:2233"/>
<structref name="RVAD Frame - Relative volume adjustment" id="2236" repeatmin="0" structure="id:2235"/>
<structref name="RVA2 Frame - Relative volume adjustment (2)" id="2238" repeatmin="0" structure="id:2237"/>
<structref name="RVRB Frame - Reverb" id="2240" repeatmin="0" structure="id:2239"/>
<structref name="SEEK Frame - Seek frame" id="2242" repeatmin="0" structure="id:2241"/>
<structref name="SIGN Frame - Signature frame" id="2244" repeatmin="0" structure="id:2243"/>
<structref name="SYLT Frame - Synchronized lyric/text" id="2246" repeatmin="0" structure="id:2245"/>
<structref name="SYTC Frame - Synchronized tempo codes" id="2248" repeatmin="0" structure="id:2247"/>
<structref name="TALB Frame - Album/Movie/Show title" id="2250" repeatmin="0" structure="id:2249"/>
<structref name="TBPM Frame - BPM (beats per minute)" id="2252" repeatmin="0" structure="id:2251"/>
<structref name="TCOM Frame - Composer" id="2254" repeatmin="0" structure="id:2253"/>
<structref name="TCON Frame - Content type" id="2256" repeatmin="0" structure="id:2255"/>
<structref name="TCOP Frame - Copyright message" id="2258" repeatmin="0" structure="id:2257"/>
<structref name="TDAT Frame - Date" id="2260" repeatmin="0" structure="id:2259"/>
<structref name="TDEN Frame - Encoding time" id="2262" repeatmin="0" structure="id:2261"/>
<structref name="TDLY Frame - Playlist delay" id="2264" repeatmin="0" structure="id:2263"/>
<structref name="TDOR Frame - Original release time" id="2266" repeatmin="0" structure="id:2265"/>
<structref name="TDRC Frame - Recording time" id="2268" repeatmin="0" structure="id:2267"/>
<structref name="TDRL Frame - Release time" id="2270" repeatmin="0" structure="id:2269"/>
<structref name="TDTG Frame - Tagging time" id="2272" repeatmin="0" structure="id:2271"/>
<structref name="TENC Frame - Encoded by" id="2274" repeatmin="0" structure="id:2273"/>
<structref name="TEXT Frame - Lyricist/Text writer" id="2276" repeatmin="0" structure="id:2275"/>
<structref name="TFLT Frame - File type" id="2278" repeatmin="0" structure="id:2277"/>
<structref name="TIME Frame - Time" id="2280" repeatmin="0" structure="id:2279"/>
<structref name="TIPL Frame - Involved people list" id="2282" repeatmin="0" structure="id:2281"/>
<structref name="TIT1 Frame - Content group description" id="2284" repeatmin="0" structure="id:2283"/>
<structref name="TIT2 Frame" id="2286" repeatmin="0" structure="id:2285"/>
<structref name="TIT3 Frame - Subtitle/Description refinement" id="2288" repeatmin="0" structure="id:2287"/>
<structref name="TKEY Frame - Initial key" id="2290" repeatmin="0" structure="id:2289"/>
<structref name="TLAN Frame - Language(s)" id="2292" repeatmin="0" structure="id:2291"/>
<structref name="TLEN Frame - Length" id="2294" repeatmin="0" structure="id:2293"/>
<structref name="TMCL Frame - Musician credits list" id="2296" repeatmin="0" structure="id:2295"/>
<structref name="TMED Frame - Media type" id="2298" repeatmin="0" structure="id:2297"/>
<structref name="TMOO Frame - Mood" id="2300" repeatmin="0" structure="id:2299"/>
<structref name="TOAL Frame - Original album/movie/show title" id="2302" repeatmin="0" structure="id:2301"/>
<structref name="TOFN Frame - Original filename" id="2304" repeatmin="0" structure="id:2303"/>
<structref name="TOLY Frame - Original lyricist(s)/text writer(s)" id="2306" repeatmin="0" structure="id:2305"/>
<structref name="TOPE Frame - Original artist(s)/performer(s)" id="2308" repeatmin="0" structure="id:2307"/>
<structref name="TORY Frame - Original release year" id="2310" repeatmin="0" structure="id:2309"/>
<structref name="TOWN Frame - File owner/licensee" id="2312" repeatmin="0" structure="id:2311"/>
<structref name="TPE1 Frame" id="2314" repeatmin="0" structure="id:2313"/>
<structref name="TPE2 Frame - Band/orchestra/accompaniment" id="2316" repeatmin="0" structure="id:2315"/>
<structref name="TPE3 Frame - Conductor/performer refinement" id="2318" repeatmin="0" structure="id:2317"/>
<structref name="TPE4 Frame - Interpreted, remixed, or otherwise modified by" id="2320" repeatmin="0" structure="id:2319"/>
<structref name="TPOS Frame - Part of a set" id="2322" repeatmin="0" structure="id:2321"/>
<structref name="TPUB Frame - Publisher" id="2324" repeatmin="0" structure="id:2323"/>
<structref name="TPRO Frame - Produced notice" id="2326" repeatmin="0" structure="id:2325"/>
<structref name="TRCK Frame - Track number/Position in set" id="2328" repeatmin="0" structure="id:2327"/>
<structref name="TRDA Frame - Recording dates" id="2330" repeatmin="0" structure="id:2329"/>
<structref name="TRSN Frame - Internet radio station name" id="2332" repeatmin="0" structure="id:2331"/>
<structref name="TRSO Frame - Internet radio station owner" id="2334" repeatmin="0" structure="id:2333"/>
<structref name="TSIZ Frame - Size" id="2336" repeatmin="0" structure="id:2335"/>
<structref name="TSOA Frame - Album sort order" id="2338" repeatmin="0" structure="id:2337"/>
<structref name="TSOP Frame - Performer sort order" id="2340" repeatmin="0" structure="id:2339"/>
<structref name="TSOT Frame - Title sort order" id="2342" repeatmin="0" structure="id:2341"/>
<structref name="TSRC Frame - ISRC (international standard recording code)" id="2344" repeatmin="0" structure="id:2343"/>
<structref name="TSSE Frame - Software/Hardware and settings used for encoding" id="2346" repeatmin="0" structure="id:2345"/>
<structref name="TSST Frame - Set subtitle" id="2348" repeatmin="0" structure="id:2347"/>
<structref name="TYER Frame - Year" id="2350" repeatmin="0" structure="id:2349"/>
<structref name="TXXX Frame - User defined text information frame" id="2352" repeatmin="0" structure="id:2351"/>
<structref name="UFID Frame - Unique file identifier" id="2354" repeatmin="0" structure="id:2353"/>
<structref name="USER Frame - Terms of use" id="2356" repeatmin="0" structure="id:2355"/>
<structref name="USLT Frame - Unsychronized lyric/text transcription" id="2358" repeatmin="0" structure="id:2357"/>
<structref name="WCOM Frame - Commercial information" id="2360" repeatmin="0" structure="id:2359"/>
<structref name="WCOP Frame - Copyright/Legal information" id="2362" repeatmin="0" structure="id:2361"/>
<structref name="WOAF Frame - Official audio file webpage" id="2364" repeatmin="0" structure="id:2363"/>
<structref name="WOAR Frame - Official artist/performer webpage" id="2366" repeatmin="0" structure="id:2365"/>
<structref name="WOAS Frame - Official audio source webpage" id="2368" repeatmin="0" structure="id:2367"/>
<structref name="WORS Frame - Official internet radio station homepage" id="2370" repeatmin="0" structure="id:2369"/>
<structref name="WPAY Frame - Payment" id="2372" repeatmin="0" structure="id:2371"/>
<structref name="WPUB Frame - Publishers official webpage" id="2374" repeatmin="0" structure="id:2373"/>
<structref name="WXXX Frame - User defined URL link frame" id="2376" repeatmin="0" structure="id:2375"/>
<structref name="ID3v2 Frame" id="2378" repeatmin="0" structure="id:2377"/>
</structure>
</structure>
</structure>
<structure name="ID3v2.0 Frame" id="2179" length="Size + 6" encoding="ISO_8859-1:1987" endian="big" signed="no">
<string name="Frame ID" mustmatch="yes" id="2382" fillcolor="D4FB78" type="fixed-length" length="3"/>
<number name="Size" id="2383" fillcolor="73FDFF" type="integer" length="3"/>
</structure>
<structure name="BUF Frame - Recommended buffer size" id="2056" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>Sometimes the server from which a audio file is streamed is aware of transmission or coding problems resulting in interruptions in the audio stream. In these cases, the size of the buffer can be recommended by the server using this frame. If the 'embedded info flag' is true (1) then this indicates that an ID3 tag with the maximum size described in 'Buffer size' may occur in the audiostream.
In such case the tag should reside between two MPEG [MPEG] frames, if the audio is MPEG encoded. If the position of the next tag is known, offset to next tag' may be used. The offset is calculated from the end of tag in which this frame resides to the first byte of the header in the next. This field may be omitted. Embedded tags is currently not recommended since this could render unpredictable behaviour from present software/hardware. The 'Buffer size' should be kept to a minimum. There may only be one "BUF" frame in each tag.</description>
<string name="Frame ID" id="2385" type="fixed-length">
<fixedvalues>
<fixedvalue name="BUF" value="BUF"/>
</fixedvalues>
</string>
<number name="Size" id="2386" type="integer"/>
<number name="Embedded info flag" id="2387" type="integer" length="1"/>
<number name="Offset to next tag" id="2388" type="integer" length="4"/>
</structure>
<structure name="CNT Frame - Play counter" id="2058" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This is simply a counter of the number of times a file has been played. The value is increased by one every time the file begins to play. There may only be one "CNT" frame in each tag. When the counter reaches all one's, one byte is inserted in front of the counter thus making the counter eight bits bigger. The counter must be at least 32-bits long to begin with.</description>
<string name="Frame ID" id="2390" type="fixed-length">
<fixedvalues>
<fixedvalue name="CNT" value="CNT"/>
</fixedvalues>
</string>
<number name="Size" id="2391" type="integer"/>
<number name="Counter" id="2392" type="integer" length="4"/>
</structure>
<structure name="COM Frame - Comments" id="2060" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no" valueexpression="The actual text">
<description>This frame replaces the old 30-character comment field in ID3v1. It consists of a frame head followed by encoding, language and content descriptors and is ended with the actual comment as a text string.
Newline characters are allowed in the comment text string. There may be more than one comment frame in each tag, but only one with the same language and content descriptor.</description>
<string name="Frame ID" id="2394" type="fixed-length">
<fixedvalues>
<fixedvalue name="COM" value="COM"/>
</fixedvalues>
</string>
<number name="Size" id="2395" type="integer"/>
<number name="Text Encoding" id="2396" type="integer" length="1">
<fixedvalues>
<fixedvalue name="ISO-8859-1" value="0"/>
<fixedvalue name="Unicode" value="1"/>
</fixedvalues>
</number>
<string name="Language" id="2397" type="fixed-length" length="3"/>
<string name="Short content description" id="2398" type="zero-terminated"/>
<string name="The actual text" id="2399" type="fixed-length" length="remaining"/>
</structure>
<structure name="CRA Frame - Audio encryption" id="2062" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This frame indicates if the actual audio stream is encrypted, and by whom. Since standardisation of such encrypion scheme is beyond this document, all "CRA" frames begin with a terminated string with a URL containing an email address, or a link to a location where an email address can be found, that belongs to the organisation responsible for this specific encrypted audio file. Questions regarding the encrypted audio should be sent to the email address specified. If a $00 is found directly after the 'Frame size' and the audiofile indeed is encrypted, the whole file may be considered useless.
After the 'Owner identifier', a pointer to an unencrypted part of the audio can be specified. The 'Preview start' and 'Preview length' is described in frames. If no part is unencrypted, these fields should be left zeroed. After the 'preview length' field follows optionally a datablock required for decryption of the audio. There may be more than one "CRA" frames in a tag, but only one with the same 'Owner identifier'.</description>
<string name="Frame ID" id="2401" type="fixed-length">
<fixedvalues>
<fixedvalue name="CRA" value="CRA"/>
</fixedvalues>
</string>
<number name="Size" id="2402" type="integer"/>
<string name="Owner identifier" id="2403" type="zero-terminated"/>
<number name="Preview start" id="2404" type="integer" length="2"/>
<number name="Preview length" id="2405" type="integer" length="2"/>
<binary name="Encryption info" id="2406" length="remaining"/>
</structure>
<structure name="CRM Frame - Encrypted meta frame" id="2064" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This frame contains one or more encrypted frames. This enables protection of copyrighted information such as pictures and text, that people might want to pay extra for. Since standardisation of such an encryption scheme is beyond this document, all "CRM" frames begin with a terminated string with a URL [URL] containing an email address, or a link to a location where an email adress can be found, that belongs to the organisation responsible for this specific encrypted meta frame.
Questions regarding the encrypted frame should be sent to the indicated email address. If a $00 is found directly after the 'Frame size', the whole frame should be ignored, and preferably be removed.
The 'Owner identifier' is then followed by a short content description and explanation as to why it's encrypted. After the 'content/explanation' description, the actual encrypted block follows.
When an ID3v2 decoder encounters a "CRM" frame, it should send the datablock to the 'plugin' with the corresponding 'owner identifier' and expect to receive either a datablock with one or several ID3v2 frames after each other or an error. There may be more than one "CRM" frames in a tag, but only one with the same 'owner identifier'.</description>
<string name="Frame ID" id="2408" type="fixed-length">
<fixedvalues>
<fixedvalue name="CRM" value="CRM"/>
</fixedvalues>
</string>
<number name="Size" id="2409" type="integer"/>
<string name="Owner identifier" id="2410" type="zero-terminated"/>
<string name="Content/explanation" id="2411" type="zero-terminated"/>
<binary name="Encrypted datablock" id="2412" length="remaining"/>
</structure>
<structure name="ETC Frame - Event timing codes" id="2066" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This frame allows synchronisation with key events in a song or sound.</description>
<string name="Frame ID" id="2414" type="fixed-length">
<fixedvalues>
<fixedvalue name="ETC" value="ETC"/>
</fixedvalues>
</string>
<number name="Size" id="2415" type="integer"/>
<number name="Time stamp format" id="2416" type="integer" length="1">
<fixedvalues>
<fixedvalue name="Absolute time, 32 bit sized, using MPEG [MPEG] frames as unit" value="1"/>
<fixedvalue name="Absolute time, 32 bit sized, using milliseconds as unit" value="2"/>
</fixedvalues>
</number>
<structure name="Key Events" id="2417" repeatmax="-1">
<number name="Type" id="2418" type="integer" length="1" display="hex">
<fixedvalues>
<fixedvalue name="padding" value="0x0"/>
<fixedvalue name="end of initial silence" value="0x1"/>
<fixedvalue name="intro start" value="0x2"/>
<fixedvalue name="main part start" value="0x3"/>
<fixedvalue name="outro start" value="0x4"/>
<fixedvalue name="outro end" value="0x5"/>
<fixedvalue name="verse begins" value="0x6"/>
<fixedvalue name="refrain begins" value="0x7"/>
<fixedvalue name="interlude" value="0x8"/>
<fixedvalue name="theme start" value="0x9"/>
<fixedvalue name="variation" value="0xA"/>
<fixedvalue name="key change" value="0xB"/>
<fixedvalue name="time change" value="0xC"/>
<fixedvalue name="unwanted noise" value="0xD"/>
<fixedvalue name="not predefined sync 0" value="0xE0"/>
<fixedvalue name="not predefined sync 1" value="0xE1"/>
<fixedvalue name="not predefined sync 2" value="0xE2"/>
<fixedvalue name="not predefined sync 3" value="0xE3"/>
<fixedvalue name="not predefined sync 4" value="0xE4"/>
<fixedvalue name="not predefined sync 5" value="0xE5"/>
<fixedvalue name="not predefined sync 6" value="0xE6"/>
<fixedvalue name="not predefined sync 7" value="0xE7"/>
<fixedvalue name="not predefined sync 8" value="0xE8"/>
<fixedvalue name="not predefined sync 9" value="0xE9"/>
<fixedvalue name="not predefined sync A" value="0xEA"/>
<fixedvalue name="not predefined sync B" value="0xEB"/>
<fixedvalue name="not predefined sync C" value="0xEC"/>
<fixedvalue name="not predefined sync D" value="0xED"/>
<fixedvalue name="not predefined sync E" value="0xEE"/>
<fixedvalue name="not predefined sync F" value="0xEF"/>
<fixedvalue name="audio end (start of silence)" value="0xFD"/>
<fixedvalue name="audio file ends" value="0xFE"/>
<fixedvalue name="one more byte of events follows" value="0xFF"/>
</fixedvalues>
</number>
<number name="Time stamp" id="2419" type="integer" length="4"/>
</structure>
</structure>
<structure name="EQU Frame - Equalisation" id="2068" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This is another subjective, alignment frame. It allows the user to predefine an equalisation curve within the audio file. There may only be one "EQU" frame in each tag.</description>
<string name="Frame ID" id="2422" type="fixed-length">
<fixedvalues>
<fixedvalue name="EQU" value="EQU"/>
</fixedvalues>
</string>
<number name="Size" id="2423" type="integer"/>
<number name="AdjustmentBits" id="2424" type="integer" length="1"/>
<number name="Increment/decrement" id="2425" type="integer" length="1" lengthunit="bit">
<fixedvalues>
<fixedvalue name="decrement" value="0"/>
<fixedvalue name="increment" value="1"/>
</fixedvalues>
</number>
<number name="Frequency" id="2426" type="integer" length="15" lengthunit="bit"/>
<number name="Adjustment" id="2427" type="integer" length="AdjustmentBits" lengthunit="bit"/>
</structure>
<structure name="GEO Frame - General encapsulated object" id="2070" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>In this frame any type of file can be encapsulated. After the header, 'Frame size' and 'Encoding' follows 'MIME type' [MIME] and 'Filename' for the encapsulated object, both represented as terminated strings encoded with ISO 8859-1 [ISO-8859-1]. The filename is case sensitive.
Then follows a content description as terminated string, encoded as 'Encoding'. The last thing in the frame is the actual object. The first two strings may be omitted, leaving only their terminations. MIME type is always an ISO-8859-1 text string. There may be more than one "GEO" frame in each tag, but only one with the same content descriptor.</description>
<string name="Frame ID" id="2429" type="fixed-length">
<fixedvalues>
<fixedvalue name="GEO" value="GEO"/>
</fixedvalues>
</string>
<number name="Size" id="2430" type="integer"/>
<number name="Text Encoding" id="2431" type="integer" length="1">
<fixedvalues>
<fixedvalue name="ISO-8859-1" value="0"/>
<fixedvalue name="Unicode" value="1"/>
</fixedvalues>
</number>
<string name="MIME type" id="2432" type="zero-terminated"/>
<string name="File name" id="2433" type="zero-terminated"/>
<string name="Content description" id="2434" type="zero-terminated"/>
<binary name="Encapsulated object" id="2435" length="remaining"/>
</structure>
<structure name="IPL Frame - Involved people list" id="2072" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>Since there might be a lot of people contributing to an audio file in various ways, such as musicians and technicians, the 'Text information frames' are often insufficient to list everyone involved in a project. The 'Involved people list' is a frame containing the names of those involved, and how they were involved. The body simply contains a terminated string with the involvement directly followed by a terminated string with the involvee followed by a new involvement and so on. There may only be one "IPL" frame in each tag.</description>
<string name="Frame ID" id="2437" type="fixed-length">
<fixedvalues>
<fixedvalue name="IPL" value="IPL"/>
</fixedvalues>
</string>
<number name="Size" id="2438" type="integer"/>
<string name="People list strings" id="2439" type="zero-terminated"/>
</structure>
<structure name="LNK Frame - Linked information" id="2074" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>To keep space waste as low as possible this frame may be used to link information from another ID3v2 tag that might reside in another audio file or alone in a binary file. It is recommended that this method is only used when the files are stored on a CD-ROM or other circumstances when the risk of file seperation is low. The frame contains a frame identifier, which is the frame that should be linked into this tag, a URL [URL] field, where a reference to the file where the frame is given, and additional ID data, if needed. Data should be retrieved from the first tag found in the file to which this link points. There may be more than one "LNK" frame in a tag, but only one with the same contents. A linked frame is to be considered as part of the tag and has the same restrictions as if it was a physical part of the tag (i.e. only one "REV" frame allowed, whether it's linked or not).
Frames that may be linked and need no additional data are "IPL", "MCI", "ETC", "LLT", "STC", "RVA", "EQU", "REV", "BUF", the text information frames and the URL link frames.
The "TXX", "PIC", "GEO", "CRM" and "CRA" frames may be linked with the content descriptor as additional ID data.
The "COM", "SLT" and "ULT" frames may be linked with three bytes of language descriptor directly followed by a content descriptor as additional ID data.</description>
<string name="Frame ID" id="2441" type="fixed-length">
<fixedvalues>
<fixedvalue name="LNK" value="LNK"/>
</fixedvalues>
</string>
<number name="Size" id="2442" type="integer"/>
<string name="Frame identifier" id="2443" type="fixed-length"/>
<string name="URL" id="2444" type="zero-terminated"/>
<string name="Additional ID data" id="2445" type="fixed-length" length="remaining"/>
</structure>
<structure name="MCI Frame - Music CD Identifier" id="2076" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This frame is intended for music that comes from a CD, so that the CD can be identified in databases such as the CDDB [CDDB]. The frame consists of a binary dump of the Table Of Contents, TOC, from the CD, which is a header of 4 bytes and then 8 bytes/track on the CD making a maximum of 804 bytes. This frame requires a present and valid "TRK" frame. There may only be one "MCI" frame in each tag.</description>
<string name="Frame ID" id="2447" type="fixed-length">
<fixedvalues>
<fixedvalue name="MCI" value="MCI"/>
</fixedvalues>
</string>
<number name="Size" id="2448" type="integer"/>
<binary name="CD TOC" id="2449" length="remaining"/>
</structure>
<structure name="MLL Frame - MPEG location lookup table" id="2078" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>To increase performance and accuracy of jumps within a MPEG [MPEG] audio file, frames with timecodes in different locations in the file might be useful. The ID3 frame includes references that the software can use to calculate positions in the file. After the frame header is a descriptor of how much the 'frame counter' should increase for every reference. If this value is two then the first reference points out the second frame, the 2nd reference the 4th frame, the 3rd reference the 6th frame etc. In a similar way the 'bytes between reference' and 'milliseconds between reference' points out bytes and milliseconds respectively.
Each reference consists of two parts; a certain number of bits, as defined in 'bits for bytes deviation', that describes the difference between what is said in 'bytes between reference' and the reality and a certain number of bits, as defined in 'bits for milliseconds deviation', that describes the difference between what is said in 'milliseconds between reference' and the reality. The number of bits in every reference, i.e. 'bits for bytes deviation'+'bits for milliseconds deviation', must be a multiple of four. There may only be one "MLL" frame in each tag.</description>
<string name="Frame ID" id="2451" type="fixed-length">
<fixedvalues>
<fixedvalue name="MLL" value="MLL"/>
</fixedvalues>
</string>
<number name="Size" id="2452" type="integer"/>
<number name="MPEG frames between reference" id="2453" type="integer" length="2"/>
<number name="Bytes between reference" id="2454" type="integer" length="3"/>
<number name="Milliseconds between reference" id="2455" type="integer" length="3"/>
<number name="Bits for bytes deviation" id="2456" type="integer" length="1"/>
<number name="Bits for milliseconds deviation" id="2457" type="integer" length="1"/>
</structure>
<structure name="PIC Frame - Attached picture" id="2080" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This frame contains a picture directly related to the audio file. Image format is preferably "PNG" [PNG] or "JPG" [JFIF]. Description is a short description of the picture, represented as a terminated textstring. The description has a maximum length of 64 characters, but may be empty. There may be several pictures attached to one file, each in their individual "PIC" frame, but only one with the same content descriptor. There may only be one picture with the picture type declared as picture type $01 and $02 respectively. There is a possibility to put only a link to the image file by using the 'image format' "-->" and having a complete URL [URL] instead of picture data.
The use of linked files should however be used restrictively since there is the risk of separation of files.</description>
<string name="Frame ID" id="2459" type="fixed-length">
<fixedvalues>
<fixedvalue name="PIC" value="PIC"/>
</fixedvalues>
</string>
<number name="Size" id="2460" type="integer"/>
<number name="Text Encoding" id="2461" type="integer" length="1">
<fixedvalues>
<fixedvalue name="ISO-8859-1" value="0"/>
<fixedvalue name="Unicode" value="1"/>
</fixedvalues>
</number>
<string name="Image format" id="2462" type="fixed-length" length="3"/>
<number name="Picture type" id="2463" type="integer" length="1" display="hex">
<fixedvalues>
<fixedvalue name="Other" value="0x0"/>
<fixedvalue name="32x32 pixels 'file icon' (PNG only)" value="0x1"/>
<fixedvalue name="Other file icon" value="0x2"/>
<fixedvalue name="Cover (front)" value="0x3"/>
<fixedvalue name="Cover (back)" value="0x4"/>
<fixedvalue name="Leaflet page" value="0x5"/>
<fixedvalue name="Media (e.g. lable side of CD)" value="0x6"/>
<fixedvalue name="Lead artist/lead performer/soloist" value="0x7"/>
<fixedvalue name="Artist/performer" value="0x8"/>
<fixedvalue name="Conductor" value="0x9"/>
<fixedvalue name="Band/Orchestra" value="0xA"/>
<fixedvalue name="Composer" value="0xB"/>
<fixedvalue name="Lyricist/text writer" value="0xC"/>
<fixedvalue name="Recording Location" value="0xD"/>
<fixedvalue name="During recording" value="0xE"/>
<fixedvalue name="During performance" value="0xF"/>
<fixedvalue name="Movie/video screen capture" value="0x10"/>
<fixedvalue name="A bright coloured fish" value="0x11"/>
<fixedvalue name="Illustration" value="0x12"/>
<fixedvalue name="Band/artist logotype" value="0x13"/>
<fixedvalue name="Publisher/Studio logotype" value="0x14"/>
</fixedvalues>
</number>
<string name="Description" id="2464" type="zero-terminated"/>
<binary name="Picture data" id="2465" length="remaining"/>
</structure>
<structure name="POP Frame - Popularimeter" id="2082" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>The purpose of this frame is to specify how good an audio file is.
Many interesting applications could be found to this frame such as a playlist that features better audiofiles more often than others or it could be used to profile a persons taste and find other 'good' files by comparing people's profiles. The frame is very simple. It contains the email address to the user, one rating byte and a four byte play counter, intended to be increased with one for every time the file is played. The email is a terminated string. The rating is 1-255 where 1 is worst and 255 is best. 0 is unknown. If no personal counter is wanted it may be omitted. When the counter reaches all one's, one byte is inserted in front of the counter thus making the counter eight bits bigger in the same away as the play counter ("CNT").
There may be more than one "POP" frame in each tag, but only one with the same email address.</description>
<string name="Frame ID" id="2467" type="fixed-length">
<fixedvalues>
<fixedvalue name="POP" value="POP"/>
</fixedvalues>
</string>
<number name="Size" id="2468" type="integer"/>
<string name="Email to user" id="2469" type="zero-terminated"/>
<number name="Rating" id="2470" type="integer" length="1"/>
<number name="Counter" id="2471" type="integer" length="4"/>
</structure>
<structure name="REV Frame - Reverb" id="2084" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>Yet another subjective one. You may here adjust echoes of different kinds. Reverb left/right is the delay between every bounce in ms. Reverb bounces left/right is the number of bounces that should be made. $FF equals an infinite number of bounces. Feedback is the amount of volume that should be returned to the next echo bounce. $00 is 0%, $FF is 100%. If this value were $7F, there would be 50% volume reduction on the first bounce, yet 50% on the second and so on. Left to left means the sound from the left bounce to be played in the left speaker, while left to right means sound from the left bounce to be played in the right speaker.
'Premix left to right' is the amount of left sound to be mixed in the right before any reverb is applied, where $00 id 0% and $FF is 100%. 'Premix right to left' does the same thing, but right to left. Setting both premix to $FF would result in a mono output (if the reverb is applied symmetric). There may only be one "REV" frame in each tag.</description>
<string name="Frame ID" id="2473" type="fixed-length">
<fixedvalues>
<fixedvalue name="REV" value="REV"/>
</fixedvalues>
</string>
<number name="Size" id="2474" type="integer"/>
<number name="Reverb left (ms)" id="2475" type="integer" length="2"/>
<number name="Reverb right (ms)" id="2476" type="integer" length="2"/>
<number name="Reverb bounces, left" id="2477" type="integer" length="1"/>
<number name="Reverb bounces, right" id="2478" type="integer" length="1"/>
<number name="Reverb feedback, left to left" id="2479" type="integer" length="1"/>
<number name="Reverb feedback, left to right" id="2480" type="integer" length="1"/>
<number name="Reverb feedback, right to right" id="2481" type="integer" length="1"/>
<number name="Reverb feedback, right to left" id="2482" type="integer" length="1"/>
<number name="Premix left to right" id="2483" type="integer" length="1"/>
<number name="Premix right to left" id="2484" type="integer" length="1"/>
</structure>
<structure name="RVA Frame - Relative volume adjustment" id="2086" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This is a more subjective function than the previous ones. It allows the user to say how much he wants to increase/decrease the volume on each channel while the file is played. The purpose is to be able to align all files to a reference volume, so that you don't have to change the volume constantly. This frame may also be used to balance adjust the audio. If the volume peak levels are known then this could be described with the 'Peak volume right' and 'Peak volume left' field. If Peakvolume is not known these fields could be left zeroed or completely omitted. There may only be one "RVA" frame in each tag.</description>
<string name="Frame ID" id="2486" type="fixed-length">
<fixedvalues>
<fixedvalue name="RVA" value="RVA"/>
</fixedvalues>
</string>
<number name="Size" id="2487" type="integer"/>
<number name="Increment/decrement" id="2488" type="integer" length="4"/>
<number name="Bits used for volume descr." id="2489" type="integer" length="1"/>
<number name="Relative volume change, right" id="2490" type="integer" length="2"/>
<number name="Relative volume change, left" id="2491" type="integer" length="2"/>
<number name="Peak volume right" id="2492" type="integer" length="2"/>
<number name="Peak volume left" id="2493" type="integer" length="2"/>
</structure>
<structure name="SLT Frame - Synchronised lyrics/text" id="2088" extends="id:2179" encoding="ISO_8859-1:1987" endian="big" signed="no">
<description>This is another way of incorporating the words, said or sung lyrics, in the audio file as text, this time, however, in sync with the audio. It might also be used to describing events e.g. occurring on a stage or on the screen in sync with the audio. The header includes a content descriptor, represented with as terminated textstring. If no descriptor is entered, 'Content descriptor' is $00 (00) only.</description>
<string name="Frame ID" id="2495" type="fixed-length">
<fixedvalues>
<fixedvalue name="SLT" value="SLT"/>
</fixedvalues>
</string>
<number name="Size" id="2496" type="integer"/>
<number name="Text Encoding" id="2497" type="integer" length="1">
<fixedvalues>
<fixedvalue name="ISO-8859-1" value="0"/>
<fixedvalue name="Unicode" value="1"/>
</fixedvalues>
</number>
<string name="Language" id="2498" type="fixed-length" length="3"/>
<number name="Time stamp format" id="2499" type="integer" length="1">