music-metadata 7.12.4 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/README.md +47 -31
  2. package/lib/ParserFactory.js +37 -41
  3. package/lib/aiff/AiffParser.js +25 -17
  4. package/lib/aiff/AiffToken.js +13 -12
  5. package/lib/apev2/APEv2Parser.js +29 -32
  6. package/lib/apev2/APEv2TagMapper.js +2 -6
  7. package/lib/apev2/APEv2Token.js +13 -19
  8. package/lib/asf/AsfObject.js +42 -56
  9. package/lib/asf/AsfParser.js +15 -19
  10. package/lib/asf/AsfTagMapper.js +2 -6
  11. package/lib/asf/AsfUtil.js +4 -7
  12. package/lib/asf/GUID.js +1 -4
  13. package/lib/common/BasicParser.js +1 -5
  14. package/lib/common/CaseInsensitiveTagMap.js +2 -6
  15. package/lib/common/CombinedTagMapper.js +20 -24
  16. package/lib/common/FourCC.js +3 -6
  17. package/lib/common/GenericTagMapper.js +2 -6
  18. package/lib/common/GenericTagTypes.js +5 -10
  19. package/lib/common/MetadataCollector.js +20 -25
  20. package/lib/common/RandomFileReader.js +2 -6
  21. package/lib/common/RandomUint8ArrayReader.js +1 -5
  22. package/lib/common/Util.js +11 -25
  23. package/lib/core.js +18 -28
  24. package/lib/dsdiff/DsdiffParser.js +24 -28
  25. package/lib/dsdiff/DsdiffToken.js +4 -7
  26. package/lib/dsf/DsfChunk.js +8 -11
  27. package/lib/dsf/DsfParser.js +13 -17
  28. package/lib/flac/FlacParser.js +22 -26
  29. package/lib/id3v1/ID3v1Parser.js +16 -21
  30. package/lib/id3v1/ID3v1TagMap.js +2 -6
  31. package/lib/id3v2/AbstractID3Parser.js +13 -17
  32. package/lib/id3v2/FrameParser.js +12 -17
  33. package/lib/id3v2/ID3v22TagMapper.js +4 -8
  34. package/lib/id3v2/ID3v24TagMapper.js +5 -9
  35. package/lib/id3v2/ID3v2Parser.js +10 -14
  36. package/lib/id3v2/ID3v2Token.js +9 -12
  37. package/lib/iff/index.js +4 -7
  38. package/lib/index.js +14 -44
  39. package/lib/lyrics3/Lyrics3.js +3 -7
  40. package/lib/matroska/MatroskaDtd.js +111 -114
  41. package/lib/matroska/MatroskaParser.js +20 -24
  42. package/lib/matroska/MatroskaTagMapper.js +2 -6
  43. package/lib/matroska/types.js +6 -9
  44. package/lib/mp4/Atom.js +4 -8
  45. package/lib/mp4/AtomToken.js +29 -44
  46. package/lib/mp4/MP4Parser.js +12 -16
  47. package/lib/mp4/MP4TagMapper.js +4 -8
  48. package/lib/mpeg/ExtendedLameHeader.js +6 -9
  49. package/lib/mpeg/MpegParser.js +17 -21
  50. package/lib/mpeg/ReplayGainDataFormat.js +2 -5
  51. package/lib/mpeg/XingTag.js +9 -13
  52. package/lib/musepack/index.js +10 -12
  53. package/lib/musepack/sv7/BitReader.js +2 -6
  54. package/lib/musepack/sv7/MpcSv7Parser.js +9 -13
  55. package/lib/musepack/sv7/StreamVersion7.js +3 -6
  56. package/lib/musepack/sv8/MpcSv8Parser.js +9 -13
  57. package/lib/musepack/sv8/StreamVersion8.js +5 -9
  58. package/lib/ogg/Ogg.js +1 -2
  59. package/lib/ogg/OggParser.js +19 -24
  60. package/lib/ogg/opus/Opus.js +2 -6
  61. package/lib/ogg/opus/OpusParser.js +4 -8
  62. package/lib/ogg/speex/Speex.js +3 -6
  63. package/lib/ogg/speex/SpeexParser.js +5 -9
  64. package/lib/ogg/theora/Theora.js +2 -5
  65. package/lib/ogg/theora/TheoraParser.js +5 -9
  66. package/lib/ogg/vorbis/Vorbis.js +6 -10
  67. package/lib/ogg/vorbis/VorbisDecoder.js +2 -6
  68. package/lib/ogg/vorbis/VorbisParser.js +18 -22
  69. package/lib/ogg/vorbis/VorbisTagMapper.js +3 -7
  70. package/lib/riff/RiffChunk.js +3 -7
  71. package/lib/riff/RiffInfoTagMap.js +4 -8
  72. package/lib/type.js +1 -5
  73. package/lib/wav/BwfChunk.js +8 -11
  74. package/lib/wav/WaveChunk.js +4 -9
  75. package/lib/wav/WaveParser.js +17 -21
  76. package/lib/wavpack/WavPackParser.js +17 -21
  77. package/lib/wavpack/WavPackToken.js +4 -8
  78. package/package.json +34 -44
  79. package/lib/ParserFactory.d.ts +0 -48
  80. package/lib/aiff/AiffParser.d.ts +0 -14
  81. package/lib/aiff/AiffToken.d.ts +0 -22
  82. package/lib/apev2/APEv2Parser.d.ts +0 -30
  83. package/lib/apev2/APEv2TagMapper.d.ts +0 -4
  84. package/lib/apev2/APEv2Token.d.ts +0 -100
  85. package/lib/asf/AsfObject.d.ts +0 -319
  86. package/lib/asf/AsfParser.d.ts +0 -17
  87. package/lib/asf/AsfTagMapper.d.ts +0 -7
  88. package/lib/asf/AsfUtil.d.ts +0 -13
  89. package/lib/asf/GUID.d.ts +0 -84
  90. package/lib/common/BasicParser.d.ts +0 -17
  91. package/lib/common/CaseInsensitiveTagMap.d.ts +0 -10
  92. package/lib/common/CombinedTagMapper.d.ts +0 -19
  93. package/lib/common/FourCC.d.ts +0 -6
  94. package/lib/common/GenericTagMapper.d.ts +0 -51
  95. package/lib/common/GenericTagTypes.d.ts +0 -33
  96. package/lib/common/MetadataCollector.d.ts +0 -76
  97. package/lib/common/RandomFileReader.d.ts +0 -22
  98. package/lib/common/RandomUint8ArrayReader.d.ts +0 -18
  99. package/lib/common/Util.d.ts +0 -57
  100. package/lib/core.d.ts +0 -48
  101. package/lib/dsdiff/DsdiffParser.d.ts +0 -14
  102. package/lib/dsdiff/DsdiffToken.d.ts +0 -9
  103. package/lib/dsf/DsfChunk.d.ts +0 -86
  104. package/lib/dsf/DsfParser.d.ts +0 -9
  105. package/lib/flac/FlacParser.d.ts +0 -28
  106. package/lib/id3v1/ID3v1Parser.d.ts +0 -13
  107. package/lib/id3v1/ID3v1TagMap.d.ts +0 -4
  108. package/lib/id3v2/AbstractID3Parser.d.ts +0 -17
  109. package/lib/id3v2/FrameParser.d.ts +0 -31
  110. package/lib/id3v2/ID3v22TagMapper.d.ts +0 -9
  111. package/lib/id3v2/ID3v24TagMapper.d.ts +0 -14
  112. package/lib/id3v2/ID3v2Parser.d.ts +0 -28
  113. package/lib/id3v2/ID3v2Token.d.ts +0 -73
  114. package/lib/iff/index.d.ts +0 -33
  115. package/lib/index.d.ts +0 -45
  116. package/lib/lyrics3/Lyrics3.d.ts +0 -3
  117. package/lib/matroska/MatroskaDtd.d.ts +0 -8
  118. package/lib/matroska/MatroskaParser.d.ts +0 -37
  119. package/lib/matroska/MatroskaTagMapper.d.ts +0 -4
  120. package/lib/matroska/types.d.ts +0 -175
  121. package/lib/mp4/Atom.d.ts +0 -16
  122. package/lib/mp4/AtomToken.d.ts +0 -395
  123. package/lib/mp4/MP4Parser.d.ts +0 -30
  124. package/lib/mp4/MP4TagMapper.d.ts +0 -5
  125. package/lib/mpeg/ExtendedLameHeader.d.ts +0 -27
  126. package/lib/mpeg/MpegParser.d.ts +0 -49
  127. package/lib/mpeg/ReplayGainDataFormat.d.ts +0 -55
  128. package/lib/mpeg/XingTag.d.ts +0 -45
  129. package/lib/musepack/index.d.ts +0 -5
  130. package/lib/musepack/sv7/BitReader.d.ts +0 -13
  131. package/lib/musepack/sv7/MpcSv7Parser.d.ts +0 -8
  132. package/lib/musepack/sv7/StreamVersion7.d.ts +0 -28
  133. package/lib/musepack/sv8/MpcSv8Parser.d.ts +0 -6
  134. package/lib/musepack/sv8/StreamVersion8.d.ts +0 -40
  135. package/lib/ogg/Ogg.d.ts +0 -72
  136. package/lib/ogg/OggParser.d.ts +0 -23
  137. package/lib/ogg/opus/Opus.d.ts +0 -48
  138. package/lib/ogg/opus/OpusParser.d.ts +0 -25
  139. package/lib/ogg/speex/Speex.d.ts +0 -36
  140. package/lib/ogg/speex/SpeexParser.d.ts +0 -22
  141. package/lib/ogg/theora/Theora.d.ts +0 -20
  142. package/lib/ogg/theora/TheoraParser.d.ts +0 -28
  143. package/lib/ogg/vorbis/Vorbis.d.ts +0 -69
  144. package/lib/ogg/vorbis/VorbisDecoder.d.ts +0 -12
  145. package/lib/ogg/vorbis/VorbisParser.d.ts +0 -36
  146. package/lib/ogg/vorbis/VorbisTagMapper.d.ts +0 -7
  147. package/lib/riff/RiffChunk.d.ts +0 -16
  148. package/lib/riff/RiffInfoTagMap.d.ts +0 -10
  149. package/lib/type.d.ts +0 -592
  150. package/lib/wav/BwfChunk.d.ts +0 -17
  151. package/lib/wav/WaveChunk.d.ts +0 -64
  152. package/lib/wav/WaveParser.d.ts +0 -24
  153. package/lib/wavpack/WavPackParser.d.ts +0 -14
  154. package/lib/wavpack/WavPackToken.d.ts +0 -64
@@ -1,319 +0,0 @@
1
- /// <reference types="node" />
2
- import { IGetToken, ITokenizer } from 'strtok3/lib/core';
3
- import { IPicture, ITag } from '../type';
4
- import GUID from './GUID';
5
- /**
6
- * Data Type: Specifies the type of information being stored. The following values are recognized.
7
- */
8
- export declare enum DataType {
9
- /**
10
- * Unicode string. The data consists of a sequence of Unicode characters.
11
- */
12
- UnicodeString = 0,
13
- /**
14
- * BYTE array. The type of data is implementation-specific.
15
- */
16
- ByteArray = 1,
17
- /**
18
- * BOOL. The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values.
19
- */
20
- Bool = 2,
21
- /**
22
- * DWORD. The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer.
23
- */
24
- DWord = 3,
25
- /**
26
- * QWORD. The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer.
27
- */
28
- QWord = 4,
29
- /**
30
- * WORD. The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer.
31
- */
32
- Word = 5
33
- }
34
- /**
35
- * Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575
36
- */
37
- export interface IAsfObjectHeader {
38
- /**
39
- * A GUID that identifies the object. 128 bits
40
- */
41
- objectId: GUID;
42
- /**
43
- * The size of the object (64-bits)
44
- */
45
- objectSize: number;
46
- }
47
- /**
48
- * Interface for: 3. ASF top-level Header Object
49
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3
50
- */
51
- export interface IAsfTopLevelObjectHeader extends IAsfObjectHeader {
52
- numberOfHeaderObjects: number;
53
- }
54
- /**
55
- * Token for: 3. ASF top-level Header Object
56
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3
57
- */
58
- export declare const TopLevelHeaderObjectToken: IGetToken<IAsfTopLevelObjectHeader, Buffer>;
59
- /**
60
- * Token for: 3.1 Header Object (mandatory, one only)
61
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_1
62
- */
63
- export declare const HeaderObjectToken: IGetToken<IAsfObjectHeader, Buffer>;
64
- export declare abstract class State<T> implements IGetToken<T> {
65
- len: number;
66
- constructor(header: IAsfObjectHeader);
67
- abstract get(buf: Buffer, off: number): T;
68
- protected postProcessTag(tags: ITag[], name: string, valueType: number, data: any): void;
69
- }
70
- export declare class IgnoreObjectState extends State<any> {
71
- constructor(header: IAsfObjectHeader);
72
- get(buf: Buffer, off: number): null;
73
- }
74
- /**
75
- * Interface for: 3.2: File Properties Object (mandatory, one only)
76
- *
77
- * The File Properties Object defines the global characteristics of the combined digital media streams found within the Data Object.
78
- */
79
- export interface IFilePropertiesObject {
80
- /**
81
- * Specifies the unique identifier for this file.
82
- * The value of this field shall be regenerated every time the file is modified in any way.
83
- * The value of this field shall be identical to the value of the File ID field of the Data Object.
84
- */
85
- fileId: GUID;
86
- /**
87
- * Specifies the size, in bytes, of the entire file.
88
- * The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
89
- */
90
- fileSize: bigint;
91
- /**
92
- * Specifies the date and time of the initial creation of the file. The value is given as the number of 100-nanosecond
93
- * intervals since January 1, 1601, according to Coordinated Universal Time (Greenwich Mean Time). The value of this
94
- * field may be invalid if the Broadcast Flag bit in the Flags field is set to 1.
95
- */
96
- creationDate: bigint;
97
- /**
98
- * Specifies the number of Data Packet entries that exist within the Data Object. The value of this field is invalid
99
- * if the Broadcast Flag bit in the Flags field is set to 1.
100
- */
101
- dataPacketsCount: bigint;
102
- /**
103
- * Specifies the time needed to play the file in 100-nanosecond units.
104
- * This value should include the duration (estimated, if an exact value is unavailable) of the the last media object
105
- * in the presentation. The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
106
- */
107
- playDuration: bigint;
108
- /**
109
- * Specifies the time needed to send the file in 100-nanosecond units.
110
- * This value should include the duration of the last packet in the content.
111
- * The value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
112
- * Players can ignore this value.
113
- */
114
- sendDuration: bigint;
115
- /**
116
- * Specifies the amount of time to buffer data before starting to play the file, in millisecond units.
117
- * If this value is nonzero, the Play Duration field and all of the payload Presentation Time fields have been offset
118
- * by this amount. Therefore, player software must subtract the value in the preroll field from the play duration and
119
- * presentation times to calculate their actual values. It follows that all payload Presentation Time fields need to
120
- * be at least this value.
121
- */
122
- preroll: bigint;
123
- /**
124
- * The flags
125
- */
126
- flags: {
127
- /**
128
- * Specifies, if set, that a file is in the process of being created (for example, for recording applications),
129
- * and thus that various values stored in the header objects are invalid. It is highly recommended that
130
- * post-processing be performed to remove this condition at the earliest opportunity.
131
- */
132
- broadcast: boolean;
133
- /**
134
- * Specifies, if set, that a file is seekable.
135
- * Note that for files containing a single audio stream and a Minimum Data Packet Size field equal to the Maximum
136
- * Data Packet Size field, this flag shall always be set to 1.
137
- * For files containing a single audio stream and a video stream or mutually exclusive video streams,
138
- * this flag is only set to 1 if the file contains a matching Simple Index Object for each regular video stream
139
- * (that is, video streams that are not hidden according to the method described in section 8.2.2).
140
- */
141
- seekable: boolean;
142
- };
143
- /**
144
- * Specifies the minimum Data Packet size in bytes. In general, the value of this field is invalid if the Broadcast
145
- * Flag bit in the Flags field is set to 1.
146
- * However, for the purposes of this specification, the values for the Minimum Data Packet Size and Maximum Data
147
- * Packet Size fields shall be set to the same value, and this value should be set to the packet size, even when the
148
- * Broadcast Flag in the Flags field is set to 1.
149
- */
150
- minimumDataPacketSize: number;
151
- /**
152
- * Specifies the maximum Data Packet size in bytes.
153
- * In general, the value of this field is invalid if the Broadcast Flag bit in the Flags field is set to 1.
154
- * However, for the purposes of this specification, the values of the Minimum Data Packet Size and Maximum Data Packet
155
- * Size fields shall be set to the same value,
156
- * and this value should be set to the packet size, even when the Broadcast Flag field is set to 1.
157
- */
158
- maximumDataPacketSize: number;
159
- /**
160
- * Specifies the maximum instantaneous bit rate in bits per second for the entire file.
161
- * This shall equal the sum of the bit rates of the individual digital media streams.
162
- * It shall be noted that the digital media stream includes ASF data packetization overhead as well as digital media
163
- * data in payloads.
164
- * Only those streams that have a free-standing Stream Properties Object in the header shall have their bit rates
165
- * included in the sum;
166
- * streams whose Stream Properties Object exists as part of an Extended Stream Properties Object in the Header
167
- * Extension Object shall not have their bit rates included in this sum, except when this value would otherwise be 0.
168
- */
169
- maximumBitrate: number;
170
- }
171
- /**
172
- * Token for: 3.2: File Properties Object (mandatory, one only)
173
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_2
174
- */
175
- export declare class FilePropertiesObject extends State<IFilePropertiesObject> {
176
- static guid: GUID;
177
- constructor(header: IAsfObjectHeader);
178
- get(buf: Buffer, off: number): IFilePropertiesObject;
179
- }
180
- /**
181
- * Interface for: 3.3 Stream Properties Object (mandatory, one per stream)
182
- */
183
- export interface IStreamPropertiesObject {
184
- /**
185
- * Stream Type
186
- */
187
- streamType: string;
188
- /**
189
- * Error Correction Type
190
- */
191
- errorCorrectionType: GUID;
192
- }
193
- /**
194
- * Token for: 3.3 Stream Properties Object (mandatory, one per stream)
195
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_3
196
- */
197
- export declare class StreamPropertiesObject extends State<IStreamPropertiesObject> {
198
- static guid: GUID;
199
- constructor(header: IAsfObjectHeader);
200
- get(buf: Buffer, off: number): IStreamPropertiesObject;
201
- }
202
- export interface IHeaderExtensionObject {
203
- reserved1: GUID;
204
- reserved2: number;
205
- extensionDataSize: number;
206
- }
207
- /**
208
- * 3.4: Header Extension Object (mandatory, one only)
209
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_4
210
- */
211
- export declare class HeaderExtensionObject implements IGetToken<IHeaderExtensionObject> {
212
- static guid: GUID;
213
- len: number;
214
- constructor();
215
- get(buf: Buffer, off: number): IHeaderExtensionObject;
216
- }
217
- export interface ICodecEntry {
218
- type: {
219
- videoCodec: boolean;
220
- audioCodec: boolean;
221
- };
222
- codecName: string;
223
- description: string;
224
- information: Buffer;
225
- }
226
- /**
227
- * 3.5: Read the Codec-List-Object, which provides user-friendly information about the codecs and formats used to encode the content found in the ASF file.
228
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_5
229
- */
230
- export declare function readCodecEntries(tokenizer: ITokenizer): Promise<ICodecEntry[]>;
231
- /**
232
- * 3.10 Content Description Object (optional, one only)
233
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_10
234
- */
235
- export declare class ContentDescriptionObjectState extends State<ITag[]> {
236
- static guid: GUID;
237
- private static contentDescTags;
238
- constructor(header: IAsfObjectHeader);
239
- get(buf: Buffer, off: number): ITag[];
240
- }
241
- /**
242
- * 3.11 Extended Content Description Object (optional, one only)
243
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3_11
244
- */
245
- export declare class ExtendedContentDescriptionObjectState extends State<ITag[]> {
246
- static guid: GUID;
247
- constructor(header: IAsfObjectHeader);
248
- get(buf: Buffer, off: number): ITag[];
249
- }
250
- export interface IStreamName {
251
- streamLanguageId: number;
252
- streamName: string;
253
- }
254
- /**
255
- * 4.1 Extended Stream Properties Object (optional, 1 per media stream)
256
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/04_objects_in_the_asf_header_extension_object.html#4_1
257
- */
258
- export interface IExtendedStreamPropertiesObject {
259
- startTime: bigint;
260
- endTime: bigint;
261
- dataBitrate: number;
262
- bufferSize: number;
263
- initialBufferFullness: number;
264
- alternateDataBitrate: number;
265
- alternateBufferSize: number;
266
- alternateInitialBufferFullness: number;
267
- maximumObjectSize: number;
268
- flags: {
269
- reliableFlag: boolean;
270
- seekableFlag: boolean;
271
- resendLiveCleanpointsFlag: boolean;
272
- };
273
- streamNumber: number;
274
- streamLanguageId: number;
275
- averageTimePerFrame: number;
276
- streamNameCount: number;
277
- payloadExtensionSystems: number;
278
- streamNames: IStreamName[];
279
- streamPropertiesObject: number;
280
- }
281
- /**
282
- * 4.1 Extended Stream Properties Object (optional, 1 per media stream)
283
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/04_objects_in_the_asf_header_extension_object.html#4_1
284
- */
285
- export declare class ExtendedStreamPropertiesObjectState extends State<IExtendedStreamPropertiesObject> {
286
- static guid: GUID;
287
- constructor(header: IAsfObjectHeader);
288
- get(buf: Buffer, off: number): IExtendedStreamPropertiesObject;
289
- }
290
- /**
291
- * 4.7 Metadata Object (optional, 0 or 1)
292
- * Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/04_objects_in_the_asf_header_extension_object.html#4_7
293
- */
294
- export declare class MetadataObjectState extends State<ITag[]> {
295
- static guid: GUID;
296
- constructor(header: IAsfObjectHeader);
297
- get(uint8Array: Uint8Array, off: number): ITag[];
298
- }
299
- export declare class MetadataLibraryObjectState extends MetadataObjectState {
300
- static guid: GUID;
301
- constructor(header: IAsfObjectHeader);
302
- }
303
- export interface IWmPicture extends IPicture {
304
- type: string;
305
- format: string;
306
- description: string;
307
- size: number;
308
- data: Buffer;
309
- }
310
- /**
311
- * Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/dd757977(v=vs.85).aspx
312
- */
313
- export declare class WmPictureToken implements IGetToken<IWmPicture> {
314
- len: any;
315
- static fromBase64(base64str: string): IPicture;
316
- static fromBuffer(buffer: Buffer): IWmPicture;
317
- constructor(len: any);
318
- get(buffer: Buffer, offset: number): IWmPicture;
319
- }
@@ -1,17 +0,0 @@
1
- import { BasicParser } from '../common/BasicParser';
2
- /**
3
- * Windows Media Metadata Usage Guidelines
4
- * - Ref: https://msdn.microsoft.com/en-us/library/ms867702.aspx
5
- *
6
- * Ref:
7
- * - https://tools.ietf.org/html/draft-fleischman-asf-01
8
- * - https://hwiegman.home.xs4all.nl/fileformats/asf/ASF_Specification.pdf
9
- * - http://drang.s4.xrea.com/program/tips/id3tag/wmp/index.html
10
- * - https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575(v=vs.85).aspx
11
- */
12
- export declare class AsfParser extends BasicParser {
13
- parse(): Promise<void>;
14
- private parseObjectHeader;
15
- private addTags;
16
- private parseExtensionObject;
17
- }
@@ -1,7 +0,0 @@
1
- import { CommonTagMapper } from '../common/GenericTagMapper';
2
- import { IRating, ITag } from '../type';
3
- export declare class AsfTagMapper extends CommonTagMapper {
4
- static toRating(rating: string): IRating;
5
- constructor();
6
- protected postMap(tag: ITag): void;
7
- }
@@ -1,13 +0,0 @@
1
- /// <reference types="node" />
2
- import { DataType } from './AsfObject';
3
- export declare type AttributeParser = (buf: Buffer) => boolean | string | number | bigint | Buffer;
4
- export declare class AsfUtil {
5
- static getParserForAttr(i: DataType): AttributeParser;
6
- static parseUnicodeAttr(uint8Array: Uint8Array): string;
7
- private static attributeParsers;
8
- private static parseByteArrayAttr;
9
- private static parseBoolAttr;
10
- private static parseDWordAttr;
11
- private static parseQWordAttr;
12
- private static parseWordAttr;
13
- }
package/lib/asf/GUID.d.ts DELETED
@@ -1,84 +0,0 @@
1
- /// <reference types="node" />
2
- /**
3
- * Ref:
4
- * - https://tools.ietf.org/html/draft-fleischman-asf-01, Appendix A: ASF GUIDs
5
- * - http://drang.s4.xrea.com/program/tips/id3tag/wmp/10_asf_guids.html
6
- * - http://drang.s4.xrea.com/program/tips/id3tag/wmp/index.html
7
- * - http://drang.s4.xrea.com/program/tips/id3tag/wmp/10_asf_guids.html
8
- *
9
- * ASF File Structure:
10
- * - https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575(v=vs.85).aspx
11
- *
12
- * ASF GUIDs:
13
- * - http://drang.s4.xrea.com/program/tips/id3tag/wmp/10_asf_guids.html
14
- * - https://github.com/dji-sdk/FFmpeg/blob/master/libavformat/asf.c
15
- */
16
- export default class GUID {
17
- str: string;
18
- static HeaderObject: GUID;
19
- static DataObject: GUID;
20
- static SimpleIndexObject: GUID;
21
- static IndexObject: GUID;
22
- static MediaObjectIndexObject: GUID;
23
- static TimecodeIndexObject: GUID;
24
- static FilePropertiesObject: GUID;
25
- static StreamPropertiesObject: GUID;
26
- static HeaderExtensionObject: GUID;
27
- static CodecListObject: GUID;
28
- static ScriptCommandObject: GUID;
29
- static MarkerObject: GUID;
30
- static BitrateMutualExclusionObject: GUID;
31
- static ErrorCorrectionObject: GUID;
32
- static ContentDescriptionObject: GUID;
33
- static ExtendedContentDescriptionObject: GUID;
34
- static ContentBrandingObject: GUID;
35
- static StreamBitratePropertiesObject: GUID;
36
- static ContentEncryptionObject: GUID;
37
- static ExtendedContentEncryptionObject: GUID;
38
- static DigitalSignatureObject: GUID;
39
- static PaddingObject: GUID;
40
- static ExtendedStreamPropertiesObject: GUID;
41
- static AdvancedMutualExclusionObject: GUID;
42
- static GroupMutualExclusionObject: GUID;
43
- static StreamPrioritizationObject: GUID;
44
- static BandwidthSharingObject: GUID;
45
- static LanguageListObject: GUID;
46
- static MetadataObject: GUID;
47
- static MetadataLibraryObject: GUID;
48
- static IndexParametersObject: GUID;
49
- static MediaObjectIndexParametersObject: GUID;
50
- static TimecodeIndexParametersObject: GUID;
51
- static CompatibilityObject: GUID;
52
- static AdvancedContentEncryptionObject: GUID;
53
- static AudioMedia: GUID;
54
- static VideoMedia: GUID;
55
- static CommandMedia: GUID;
56
- static JFIF_Media: GUID;
57
- static Degradable_JPEG_Media: GUID;
58
- static FileTransferMedia: GUID;
59
- static BinaryMedia: GUID;
60
- static ASF_Index_Placeholder_Object: GUID;
61
- static fromBin(bin: Buffer, offset?: number): GUID;
62
- /**
63
- * Decode GUID in format like "B503BF5F-2EA9-CF11-8EE3-00C00C205365"
64
- * @param objectId Binary GUID
65
- * @param offset Read offset in bytes, default 0
66
- * @returns GUID as dashed hexadecimal representation
67
- */
68
- static decode(objectId: Buffer, offset?: number): string;
69
- /**
70
- * Decode stream type
71
- * @param mediaType Media type GUID
72
- * @returns Media type
73
- */
74
- static decodeMediaType(mediaType: GUID): 'audio' | 'video' | 'command' | 'degradable-jpeg' | 'file-transfer' | 'binary' | undefined;
75
- /**
76
- * Encode GUID
77
- * @param guid GUID like: "B503BF5F-2EA9-CF11-8EE3-00C00C205365"
78
- * @returns Encoded Binary GUID
79
- */
80
- static encode(str: string): Buffer;
81
- constructor(str: string);
82
- equals(guid: GUID): boolean;
83
- toBin(): Buffer;
84
- }
@@ -1,17 +0,0 @@
1
- import { ITokenizer } from 'strtok3/lib/core';
2
- import { ITokenParser } from '../ParserFactory';
3
- import { IOptions, IPrivateOptions } from '../type';
4
- import { INativeMetadataCollector } from './MetadataCollector';
5
- export declare abstract class BasicParser implements ITokenParser {
6
- protected metadata: INativeMetadataCollector;
7
- protected tokenizer: ITokenizer;
8
- protected options: IPrivateOptions;
9
- /**
10
- * Initialize parser with output (metadata), input (tokenizer) & parsing options (options).
11
- * @param {INativeMetadataCollector} metadata Output
12
- * @param {ITokenizer} tokenizer Input
13
- * @param {IOptions} options Parsing options
14
- */
15
- init(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): ITokenParser;
16
- abstract parse(): any;
17
- }
@@ -1,10 +0,0 @@
1
- import { INativeTagMap, TagType } from './GenericTagTypes';
2
- import { CommonTagMapper } from './GenericTagMapper';
3
- export declare class CaseInsensitiveTagMap extends CommonTagMapper {
4
- constructor(tagTypes: TagType[], tagMap: INativeTagMap);
5
- /**
6
- * @tag Native header tag
7
- * @return common tag name (alias)
8
- */
9
- protected getCommonName(tag: string): import("./GenericTagTypes").GenericTagId;
10
- }
@@ -1,19 +0,0 @@
1
- import { IGenericTag, TagType } from './GenericTagTypes';
2
- import { IGenericTagMapper } from './GenericTagMapper';
3
- import { ITag } from '../type';
4
- import { INativeMetadataCollector } from './MetadataCollector';
5
- export declare class CombinedTagMapper {
6
- tagMappers: {
7
- [index: string]: IGenericTagMapper;
8
- };
9
- constructor();
10
- /**
11
- * Convert native to generic (common) tags
12
- * @param tagType Originating tag format
13
- * @param tag Native tag to map to a generic tag id
14
- * @param warnings
15
- * @return Generic tag result (output of this function)
16
- */
17
- mapTag(tagType: TagType, tag: ITag, warnings: INativeMetadataCollector): IGenericTag;
18
- private registerTagMapper;
19
- }
@@ -1,6 +0,0 @@
1
- import { IToken } from 'strtok3/lib/core';
2
- /**
3
- * Token for read FourCC
4
- * Ref: https://en.wikipedia.org/wiki/FourCC
5
- */
6
- export declare const FourCcToken: IToken<string>;
@@ -1,51 +0,0 @@
1
- import * as generic from './GenericTagTypes';
2
- import { ITag } from '../type';
3
- import { INativeMetadataCollector, IWarningCollector } from './MetadataCollector';
4
- export interface IGenericTagMapper {
5
- /**
6
- * Which tagType it able to map to the generic mapping format
7
- */
8
- tagTypes: generic.TagType[];
9
- /**
10
- * Basic tag map
11
- */
12
- tagMap: generic.INativeTagMap;
13
- /**
14
- * Map native tag to generic tag
15
- * @param tag Native tag
16
- * @param warnings Register warnings
17
- * @return Generic tag, if native tag could be mapped
18
- */
19
- mapGenericTag(tag: ITag, warnings: INativeMetadataCollector): generic.IGenericTag;
20
- }
21
- export declare class CommonTagMapper implements IGenericTagMapper {
22
- tagTypes: generic.TagType[];
23
- tagMap: generic.INativeTagMap;
24
- static maxRatingScore: number;
25
- static toIntOrNull(str: string): number;
26
- static normalizeTrack(origVal: number | string): {
27
- no: number;
28
- of: number;
29
- };
30
- constructor(tagTypes: generic.TagType[], tagMap: generic.INativeTagMap);
31
- /**
32
- * Process and set common tags
33
- * write common tags to
34
- * @param tag Native tag
35
- * @param warnings Register warnings
36
- * @return common name
37
- */
38
- mapGenericTag(tag: ITag, warnings: IWarningCollector): generic.IGenericTag;
39
- /**
40
- * Convert native tag key to common tag key
41
- * @tag Native header tag
42
- * @return common tag name (alias)
43
- */
44
- protected getCommonName(tag: string): generic.GenericTagId;
45
- /**
46
- * Handle post mapping exceptions / correction
47
- * @param tag Tag e.g. {"©alb", "Buena Vista Social Club")
48
- * @param warnings Used to register warnings
49
- */
50
- protected postMap(tag: ITag, warnings: IWarningCollector): void;
51
- }
@@ -1,33 +0,0 @@
1
- export declare type TagType = 'vorbis' | 'ID3v1' | 'ID3v2.2' | 'ID3v2.3' | 'ID3v2.4' | 'APEv2' | 'asf' | 'iTunes' | 'exif' | 'matroska';
2
- export interface IGenericTag {
3
- id: GenericTagId;
4
- value: any;
5
- }
6
- export declare type GenericTagId = 'track' | 'disk' | 'year' | 'title' | 'artist' | 'artists' | 'albumartist' | 'album' | 'date' | 'originaldate' | 'originalyear' | 'comment' | 'genre' | 'picture' | 'composer' | 'lyrics' | 'albumsort' | 'titlesort' | 'work' | 'artistsort' | 'albumartistsort' | 'composersort' | 'lyricist' | 'writer' | 'conductor' | 'remixer' | 'arranger' | 'engineer' | 'technician' | 'producer' | 'djmixer' | 'mixer' | 'publisher' | 'label' | 'grouping' | 'subtitle' | 'discsubtitle' | 'totaltracks' | 'totaldiscs' | 'compilation' | 'rating' | 'bpm' | 'mood' | 'media' | 'catalognumber' | 'tvShow' | 'tvShowSort' | 'tvEpisode' | 'tvEpisodeId' | 'tvNetwork' | 'tvSeason' | 'podcast' | 'podcasturl' | 'releasestatus' | 'releasetype' | 'releasecountry' | 'script' | 'language' | 'copyright' | 'license' | 'encodedby' | 'encodersettings' | 'gapless' | 'barcode' | 'isrc' | 'asin' | 'musicbrainz_recordingid' | 'musicbrainz_trackid' | 'musicbrainz_albumid' | 'musicbrainz_artistid' | 'musicbrainz_albumartistid' | 'musicbrainz_releasegroupid' | 'musicbrainz_workid' | 'musicbrainz_trmid' | 'musicbrainz_discid' | 'acoustid_id' | 'acoustid_fingerprint' | 'musicip_puid' | 'musicip_fingerprint' | 'website' | 'performer:instrument' | 'peakLevel' | 'averageLevel' | 'notes' | 'key' | 'originalalbum' | 'originalartist' | 'discogs_artist_id' | 'discogs_label_id' | 'discogs_master_release_id' | 'discogs_rating' | 'discogs_release_id' | 'discogs_votes' | 'replaygain_track_gain' | 'replaygain_track_peak' | 'replaygain_album_gain' | 'replaygain_album_peak' | 'replaygain_track_minmax' | 'replaygain_album_minmax' | 'replaygain_undo' | 'description' | 'longDescription' | 'category' | 'hdVideo' | 'keywords' | 'movement' | 'movementIndex' | 'movementTotal' | 'podcastId' | 'showMovement' | 'stik';
7
- export interface INativeTagMap {
8
- [index: string]: GenericTagId;
9
- }
10
- export interface ITagInfo {
11
- /**
12
- * True if result is an array
13
- */
14
- multiple: boolean;
15
- /**
16
- * True if the result is an array and each value in the array should be unique
17
- */
18
- unique?: boolean;
19
- }
20
- export interface ITagInfoMap {
21
- [index: string]: ITagInfo;
22
- }
23
- export declare const commonTags: ITagInfoMap;
24
- /**
25
- * @param alias Name of common tag
26
- * @returns {boolean|*} true if given alias is mapped as a singleton', otherwise false
27
- */
28
- export declare function isSingleton(alias: GenericTagId): boolean;
29
- /**
30
- * @param alias Common (generic) tag
31
- * @returns {boolean|*} true if given alias is a singleton or explicitly marked as unique
32
- */
33
- export declare function isUnique(alias: GenericTagId): boolean;
@@ -1,76 +0,0 @@
1
- import { FormatId, IAudioMetadata, ICommonTagsResult, IFormat, INativeTags, IOptions, IQualityInformation, ITrackInfo } from '../type';
2
- import { IGenericTag, TagType } from './GenericTagTypes';
3
- /**
4
- * Combines all generic-tag-mappers for each tag type
5
- */
6
- export interface IWarningCollector {
7
- /**
8
- * Register parser warning
9
- * @param warning
10
- */
11
- addWarning(warning: string): any;
12
- }
13
- export interface INativeMetadataCollector extends IWarningCollector {
14
- /**
15
- * Only use this for reading
16
- */
17
- readonly format: IFormat;
18
- readonly native: INativeTags;
19
- readonly quality: IQualityInformation;
20
- /**
21
- * @returns {boolean} true if one or more tags have been found
22
- */
23
- hasAny(): boolean;
24
- setFormat(key: FormatId, value: any): void;
25
- addTag(tagType: TagType, tagId: string, value: any): void;
26
- addStreamInfo(streamInfo: ITrackInfo): void;
27
- }
28
- /**
29
- * Provided to the parser to uodate the metadata result.
30
- * Responsible for triggering async updates
31
- */
32
- export declare class MetadataCollector implements INativeMetadataCollector {
33
- private opts;
34
- readonly format: IFormat;
35
- readonly native: INativeTags;
36
- readonly common: ICommonTagsResult;
37
- readonly quality: IQualityInformation;
38
- /**
39
- * Keeps track of origin priority for each mapped id
40
- */
41
- private readonly commonOrigin;
42
- /**
43
- * Maps a tag type to a priority
44
- */
45
- private readonly originPriority;
46
- private tagMapper;
47
- constructor(opts: IOptions);
48
- /**
49
- * @returns {boolean} true if one or more tags have been found
50
- */
51
- hasAny(): boolean;
52
- addStreamInfo(streamInfo: ITrackInfo): void;
53
- setFormat(key: FormatId, value: any): void;
54
- addTag(tagType: TagType, tagId: string, value: any): void;
55
- addWarning(warning: string): void;
56
- postMap(tagType: TagType | 'artificial', tag: IGenericTag): any;
57
- /**
58
- * Convert native tags to common tags
59
- * @returns {IAudioMetadata} Native + common tags
60
- */
61
- toCommonMetadata(): IAudioMetadata;
62
- /**
63
- * Fix some common issues with picture object
64
- * @param picture Picture
65
- */
66
- private postFixPicture;
67
- /**
68
- * Convert native tag to common tags
69
- */
70
- private toCommon;
71
- /**
72
- * Set generic tag
73
- */
74
- private setGenericTag;
75
- }
76
- export declare function joinArtists(artists: string[]): string;