music-metadata 8.0.0 → 8.1.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 (84) hide show
  1. package/README.md +4 -3
  2. package/lib/ParserFactory.d.ts +48 -0
  3. package/lib/aiff/AiffParser.d.ts +15 -0
  4. package/lib/aiff/AiffParser.js +13 -1
  5. package/lib/aiff/AiffTagMap.d.ts +4 -0
  6. package/lib/aiff/AiffTagMap.js +16 -0
  7. package/lib/aiff/AiffToken.d.ts +23 -0
  8. package/lib/apev2/APEv2Parser.d.ts +30 -0
  9. package/lib/apev2/APEv2TagMapper.d.ts +4 -0
  10. package/lib/apev2/APEv2Token.d.ts +100 -0
  11. package/lib/asf/AsfObject.d.ts +320 -0
  12. package/lib/asf/AsfParser.d.ts +17 -0
  13. package/lib/asf/AsfTagMapper.d.ts +7 -0
  14. package/lib/asf/AsfUtil.d.ts +14 -0
  15. package/lib/asf/GUID.d.ts +84 -0
  16. package/lib/common/BasicParser.d.ts +17 -0
  17. package/lib/common/CaseInsensitiveTagMap.d.ts +10 -0
  18. package/lib/common/CombinedTagMapper.d.ts +19 -0
  19. package/lib/common/CombinedTagMapper.js +3 -1
  20. package/lib/common/FourCC.d.ts +6 -0
  21. package/lib/common/FourCC.js +2 -5
  22. package/lib/common/GenericTagMapper.d.ts +51 -0
  23. package/lib/common/GenericTagTypes.d.ts +33 -0
  24. package/lib/common/MetadataCollector.d.ts +76 -0
  25. package/lib/common/MetadataCollector.js +2 -2
  26. package/lib/common/RandomFileReader.d.ts +22 -0
  27. package/lib/common/RandomUint8ArrayReader.d.ts +18 -0
  28. package/lib/common/Util.d.ts +57 -0
  29. package/lib/core.d.ts +48 -0
  30. package/lib/dsdiff/DsdiffParser.d.ts +14 -0
  31. package/lib/dsdiff/DsdiffToken.d.ts +9 -0
  32. package/lib/dsf/DsfChunk.d.ts +86 -0
  33. package/lib/dsf/DsfParser.d.ts +9 -0
  34. package/lib/flac/FlacParser.d.ts +28 -0
  35. package/lib/id3v1/ID3v1Parser.d.ts +13 -0
  36. package/lib/id3v1/ID3v1TagMap.d.ts +4 -0
  37. package/lib/id3v2/AbstractID3Parser.d.ts +17 -0
  38. package/lib/id3v2/FrameParser.d.ts +31 -0
  39. package/lib/id3v2/ID3v22TagMapper.d.ts +9 -0
  40. package/lib/id3v2/ID3v24TagMapper.d.ts +14 -0
  41. package/lib/id3v2/ID3v2Parser.d.ts +28 -0
  42. package/lib/id3v2/ID3v2Token.d.ts +73 -0
  43. package/lib/iff/index.d.ts +33 -0
  44. package/lib/index.d.ts +21 -0
  45. package/lib/lyrics3/Lyrics3.d.ts +3 -0
  46. package/lib/matroska/MatroskaDtd.d.ts +8 -0
  47. package/lib/matroska/MatroskaParser.d.ts +37 -0
  48. package/lib/matroska/MatroskaTagMapper.d.ts +4 -0
  49. package/lib/matroska/types.d.ts +175 -0
  50. package/lib/mp4/Atom.d.ts +16 -0
  51. package/lib/mp4/AtomToken.d.ts +395 -0
  52. package/lib/mp4/MP4Parser.d.ts +30 -0
  53. package/lib/mp4/MP4TagMapper.d.ts +5 -0
  54. package/lib/mpeg/ExtendedLameHeader.d.ts +27 -0
  55. package/lib/mpeg/MpegParser.d.ts +49 -0
  56. package/lib/mpeg/ReplayGainDataFormat.d.ts +55 -0
  57. package/lib/mpeg/XingTag.d.ts +45 -0
  58. package/lib/musepack/index.d.ts +5 -0
  59. package/lib/musepack/sv7/BitReader.d.ts +13 -0
  60. package/lib/musepack/sv7/MpcSv7Parser.d.ts +8 -0
  61. package/lib/musepack/sv7/StreamVersion7.d.ts +28 -0
  62. package/lib/musepack/sv8/MpcSv8Parser.d.ts +6 -0
  63. package/lib/musepack/sv8/StreamVersion8.d.ts +40 -0
  64. package/lib/ogg/Ogg.d.ts +72 -0
  65. package/lib/ogg/OggParser.d.ts +23 -0
  66. package/lib/ogg/opus/Opus.d.ts +48 -0
  67. package/lib/ogg/opus/OpusParser.d.ts +25 -0
  68. package/lib/ogg/speex/Speex.d.ts +36 -0
  69. package/lib/ogg/speex/SpeexParser.d.ts +22 -0
  70. package/lib/ogg/theora/Theora.d.ts +20 -0
  71. package/lib/ogg/theora/TheoraParser.d.ts +28 -0
  72. package/lib/ogg/vorbis/Vorbis.d.ts +69 -0
  73. package/lib/ogg/vorbis/VorbisDecoder.d.ts +12 -0
  74. package/lib/ogg/vorbis/VorbisParser.d.ts +36 -0
  75. package/lib/ogg/vorbis/VorbisTagMapper.d.ts +7 -0
  76. package/lib/riff/RiffChunk.d.ts +16 -0
  77. package/lib/riff/RiffInfoTagMap.d.ts +10 -0
  78. package/lib/type.d.ts +593 -0
  79. package/lib/wav/BwfChunk.d.ts +17 -0
  80. package/lib/wav/WaveChunk.d.ts +64 -0
  81. package/lib/wav/WaveParser.d.ts +24 -0
  82. package/lib/wavpack/WavPackParser.d.ts +14 -0
  83. package/lib/wavpack/WavPackToken.d.ts +64 -0
  84. package/package.json +13 -13
@@ -0,0 +1,395 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import { IToken, IGetToken } from 'strtok3/core';
3
+ interface IVersionAndFlags {
4
+ /**
5
+ * A 1-byte specification of the version
6
+ */
7
+ version: number;
8
+ /**
9
+ * Three bytes of space for (future) flags.
10
+ */
11
+ flags: number;
12
+ }
13
+ export interface IAtomHeader {
14
+ length: bigint;
15
+ name: string;
16
+ }
17
+ export interface IAtomFtyp {
18
+ type: string;
19
+ }
20
+ /**
21
+ * Common interface for the mvhd (Movie Header) & mdhd (Media) atom
22
+ */
23
+ export interface IAtomMxhd extends IVersionAndFlags {
24
+ /**
25
+ * A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the media atom was created.
26
+ * It is strongly recommended that this value should be specified using coordinated universal time (UTC).
27
+ */
28
+ creationTime: Date;
29
+ /**
30
+ * A 32-bit integer that specifies (in seconds since midnight, January 1, 1904) when the media atom was changed.
31
+ * It is strongly recommended that this value should be specified using coordinated universal time (UTC).
32
+ */
33
+ modificationTime: Date;
34
+ /**
35
+ * A time value that indicates the time scale for this media—that is, the number of time units that pass per second in its time coordinate system.
36
+ */
37
+ timeScale: number;
38
+ /**
39
+ * Duration: the duration of this media in units of its time scale.
40
+ */
41
+ duration: number;
42
+ }
43
+ /**
44
+ * Interface for the parsed Movie Header Atom (mvhd)
45
+ */
46
+ export interface IAtomMvhd extends IAtomMxhd {
47
+ /**
48
+ * Preferred rate: a 32-bit fixed-point number that specifies the rate at which to play this movie.
49
+ * A value of 1.0 indicates normal rate.
50
+ */
51
+ preferredRate: number;
52
+ /**
53
+ * Preferred volume: A 16-bit fixed-point number that specifies how loud to play this movie’s sound.
54
+ * A value of 1.0 indicates full volume.
55
+ */
56
+ preferredVolume: number;
57
+ /**
58
+ * Reserved: Ten bytes reserved for use by Apple. Set to 0.
59
+ */
60
+ /**
61
+ * Matrix structure: The matrix structure associated with this movie.
62
+ * A matrix shows how to map points from one coordinate space into another.
63
+ * See Matrices for a discussion of how display matrices are used in QuickTime.
64
+ */
65
+ /**
66
+ * Preview time: The time value in the movie at which the preview begins.
67
+ */
68
+ previewTime: number;
69
+ /**
70
+ * Preview duration: The duration of the movie preview in movie time scale units.
71
+ */
72
+ previewDuration: number;
73
+ /**
74
+ * Poster time: The time value of the time of the movie poster.
75
+ */
76
+ posterTime: number;
77
+ /**
78
+ * selection time: The time value for the start time of the current selection.
79
+ */
80
+ selectionTime: number;
81
+ /**
82
+ * Selection duration: The duration of the current selection in movie time scale units.
83
+ */
84
+ selectionDuration: number;
85
+ /**
86
+ * Current time: The time value for current time position within the movie.
87
+ */
88
+ currentTime: number;
89
+ /**
90
+ * Next track ID: A 32-bit integer that indicates a value to use for the track ID number of the next track added to this movie. Note that 0 is not a valid track ID value.
91
+ */
92
+ nextTrackID: number;
93
+ }
94
+ /**
95
+ * Interface for the metadata header atom: 'mhdr'
96
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW13
97
+ */
98
+ export interface IMovieHeaderAtom extends IVersionAndFlags {
99
+ /**
100
+ * A 32-bit unsigned integer indicating the value to use for the item ID of the next item created or assigned an item ID.
101
+ * If the value is all ones, it indicates that future additions will require a search for an unused item ID.
102
+ */
103
+ nextItemID: number;
104
+ }
105
+ export declare const Header: IToken<IAtomHeader>;
106
+ /**
107
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap1/qtff1.html#//apple_ref/doc/uid/TP40000939-CH203-38190
108
+ */
109
+ export declare const ExtendedSize: IToken<bigint>;
110
+ export declare const ftyp: IGetToken<IAtomFtyp>;
111
+ export declare const tkhd: IGetToken<IAtomFtyp>;
112
+ /**
113
+ * Token: Movie Header Atom
114
+ */
115
+ export declare const mhdr: IGetToken<IMovieHeaderAtom>;
116
+ /**
117
+ * Base class for 'fixed' length atoms.
118
+ * In some cases these atoms are longer then the sum of the described fields.
119
+ * Issue: https://github.com/Borewit/music-metadata/issues/120
120
+ */
121
+ export declare abstract class FixedLengthAtom {
122
+ len: number;
123
+ /**
124
+ *
125
+ * @param {number} len Length as specified in the size field
126
+ * @param {number} expLen Total length of sum of specified fields in the standard
127
+ */
128
+ protected constructor(len: number, expLen: number, atomId: string);
129
+ }
130
+ /**
131
+ * Interface for the parsed Movie Header Atom (mdhd)
132
+ */
133
+ export interface IAtomMdhd extends IAtomMxhd {
134
+ /**
135
+ * A 16-bit integer that specifies the language code for this media.
136
+ * See Language Code Values for valid language codes.
137
+ * Also see Extended Language Tag Atom for the preferred code to use here if an extended language tag is also included in the media atom.
138
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap4/qtff4.html#//apple_ref/doc/uid/TP40000939-CH206-34353
139
+ */
140
+ language: number;
141
+ quality: number;
142
+ }
143
+ /**
144
+ * Token: Media Header Atom
145
+ * Ref:
146
+ * - https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-SW34
147
+ * - https://wiki.multimedia.cx/index.php/QuickTime_container#mdhd
148
+ */
149
+ export declare class MdhdAtom extends FixedLengthAtom implements IGetToken<IAtomMdhd> {
150
+ len: number;
151
+ constructor(len: number);
152
+ get(buf: Buffer, off: number): IAtomMdhd;
153
+ }
154
+ /**
155
+ * Token: Movie Header Atom
156
+ */
157
+ export declare class MvhdAtom extends FixedLengthAtom implements IGetToken<IAtomMvhd> {
158
+ len: number;
159
+ constructor(len: number);
160
+ get(buf: Buffer, off: number): IAtomMvhd;
161
+ }
162
+ /**
163
+ * Data Atom Structure ('data')
164
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW32
165
+ */
166
+ export interface IDataAtom {
167
+ /**
168
+ * Type Indicator
169
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW28
170
+ */
171
+ type: {
172
+ /**
173
+ * The set of types from which the type is drawn
174
+ * If 0, type is drawn from the well-known set of types.
175
+ */
176
+ set: number;
177
+ type: number;
178
+ };
179
+ /**
180
+ * Locale Indicator
181
+ */
182
+ locale: number;
183
+ /**
184
+ * An array of bytes containing the value of the metadata.
185
+ */
186
+ value: Buffer;
187
+ }
188
+ /**
189
+ * Data Atom Structure
190
+ */
191
+ export declare class DataAtom implements IGetToken<IDataAtom> {
192
+ len: number;
193
+ constructor(len: number);
194
+ get(buf: Uint8Array, off: number): IDataAtom;
195
+ }
196
+ /**
197
+ * Data Atom Structure ('data')
198
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW32
199
+ */
200
+ export interface INameAtom extends IVersionAndFlags {
201
+ /**
202
+ * An array of bytes containing the value of the metadata.
203
+ */
204
+ name: string;
205
+ }
206
+ /**
207
+ * Data Atom Structure
208
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW31
209
+ */
210
+ export declare class NameAtom implements IGetToken<INameAtom> {
211
+ len: number;
212
+ constructor(len: number);
213
+ get(buf: Buffer, off: number): INameAtom;
214
+ }
215
+ /**
216
+ * Track Header Atoms interface
217
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25550
218
+ */
219
+ export interface ITrackHeaderAtom extends IVersionAndFlags {
220
+ /**
221
+ * Creation Time
222
+ */
223
+ creationTime: Date;
224
+ /**
225
+ * Modification Time
226
+ */
227
+ modificationTime: Date;
228
+ /**
229
+ * TrackID
230
+ */
231
+ trackId: number;
232
+ /**
233
+ * A time value that indicates the duration of this track (in the movie’s time coordinate system).
234
+ * Note that this property is derived from the track’s edits. The value of this field is equal to the sum of the
235
+ * durations of all of the track’s edits. If there is no edit list, then the duration is the sum of the sample
236
+ * durations, converted into the movie timescale.
237
+ */
238
+ duration: number;
239
+ /**
240
+ * A 16-bit integer that indicates this track’s spatial priority in its movie.
241
+ * The QuickTime Movie Toolbox uses this value to determine how tracks overlay one another.
242
+ * Tracks with lower layer values are displayed in front of tracks with higher layer values.
243
+ */
244
+ layer: number;
245
+ /**
246
+ * A 16-bit integer that identifies a collection of movie tracks that contain alternate data for one another.
247
+ * This same identifier appears in each 'tkhd' atom of the other tracks in the group.
248
+ * QuickTime chooses one track from the group to be used when the movie is played.
249
+ * The choice may be based on such considerations as playback quality, language, or the capabilities of the computer.
250
+ * A value of zero indicates that the track is not in an alternate track group.
251
+ */
252
+ alternateGroup: number;
253
+ /**
254
+ * A 16-bit fixed-point value that indicates how loudly this track’s sound is to be played.
255
+ * A value of 1.0 indicates normal volume.
256
+ */
257
+ volume: number;
258
+ }
259
+ /**
260
+ * Track Header Atoms structure
261
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25550
262
+ */
263
+ export declare class TrackHeaderAtom implements IGetToken<ITrackHeaderAtom> {
264
+ len: number;
265
+ constructor(len: number);
266
+ get(buf: Buffer, off: number): ITrackHeaderAtom;
267
+ }
268
+ /**
269
+ * Atom: Sample Description Atom ('stsd')
270
+ */
271
+ interface IAtomStsdHeader extends IVersionAndFlags {
272
+ numberOfEntries: number;
273
+ }
274
+ /**
275
+ * Atom: Sample Description Atom ('stsd')
276
+ */
277
+ export interface ISampleDescription {
278
+ dataFormat: string;
279
+ dataReferenceIndex: number;
280
+ description: Uint8Array;
281
+ }
282
+ export interface IAtomStsd {
283
+ header: IAtomStsdHeader;
284
+ table: ISampleDescription[];
285
+ }
286
+ /**
287
+ * Atom: Sample-description Atom ('stsd')
288
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25691
289
+ */
290
+ export declare class StsdAtom implements IGetToken<IAtomStsd> {
291
+ len: number;
292
+ constructor(len: number);
293
+ get(buf: Buffer, off: number): IAtomStsd;
294
+ }
295
+ export interface ISoundSampleDescriptionVersion {
296
+ version: number;
297
+ revision: number;
298
+ vendor: number;
299
+ }
300
+ /**
301
+ * Common Sound Sample Description (version & revision)
302
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-57317
303
+ */
304
+ export declare const SoundSampleDescriptionVersion: IGetToken<ISoundSampleDescriptionVersion>;
305
+ export interface ISoundSampleDescriptionV0 {
306
+ numAudioChannels: number;
307
+ /**
308
+ * Number of bits in each uncompressed sound sample
309
+ */
310
+ sampleSize: number;
311
+ /**
312
+ * Compression ID
313
+ */
314
+ compressionId: number;
315
+ packetSize: number;
316
+ sampleRate: number;
317
+ }
318
+ /**
319
+ * Sound Sample Description (Version 0)
320
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-130736
321
+ */
322
+ export declare const SoundSampleDescriptionV0: IGetToken<ISoundSampleDescriptionV0>;
323
+ export interface ITableAtom<T> extends IVersionAndFlags {
324
+ numberOfEntries: number;
325
+ entries: T[];
326
+ }
327
+ declare class SimpleTableAtom<T> implements IGetToken<ITableAtom<T>> {
328
+ len: number;
329
+ private token;
330
+ constructor(len: number, token: IGetToken<T>);
331
+ get(buf: Buffer, off: number): ITableAtom<T>;
332
+ }
333
+ export interface ITimeToSampleToken {
334
+ count: number;
335
+ duration: number;
336
+ }
337
+ export declare const TimeToSampleToken: IGetToken<ITimeToSampleToken>;
338
+ /**
339
+ * Time-to-sample('stts') atom.
340
+ * Store duration information for a media’s samples.
341
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25696
342
+ */
343
+ export declare class SttsAtom extends SimpleTableAtom<ITimeToSampleToken> {
344
+ len: number;
345
+ constructor(len: number);
346
+ }
347
+ /**
348
+ * Sample-to-Chunk ('stsc') atom table entry interface
349
+ */
350
+ export interface ISampleToChunk {
351
+ firstChunk: number;
352
+ samplesPerChunk: number;
353
+ sampleDescriptionId: number;
354
+ }
355
+ export declare const SampleToChunkToken: IGetToken<ISampleToChunk>;
356
+ /**
357
+ * Sample-to-Chunk ('stsc') atom interface
358
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25706
359
+ */
360
+ export declare class StscAtom extends SimpleTableAtom<ISampleToChunk> {
361
+ len: number;
362
+ constructor(len: number);
363
+ }
364
+ /**
365
+ * Sample-size ('stsz') atom interface
366
+ */
367
+ export interface IStszAtom extends ITableAtom<number> {
368
+ sampleSize: number;
369
+ }
370
+ /**
371
+ * Sample-size ('stsz') atom
372
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25710
373
+ */
374
+ export declare class StszAtom implements IGetToken<IStszAtom> {
375
+ len: number;
376
+ constructor(len: number);
377
+ get(buf: Buffer, off: number): IStszAtom;
378
+ }
379
+ /**
380
+ * Chunk offset atom, 'stco'
381
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25715
382
+ */
383
+ export declare class StcoAtom extends SimpleTableAtom<number> {
384
+ len: number;
385
+ constructor(len: number);
386
+ }
387
+ /**
388
+ * Token used to decode text-track from 'mdat' atom (raw data stream)
389
+ */
390
+ export declare class ChapterText implements IGetToken<string> {
391
+ len: number;
392
+ constructor(len: number);
393
+ get(buf: Buffer, off: number): string;
394
+ }
395
+ export {};
@@ -0,0 +1,30 @@
1
+ import { BasicParser } from '../common/BasicParser.js';
2
+ import { Atom } from './Atom.js';
3
+ export declare class MP4Parser extends BasicParser {
4
+ private static read_BE_Integer;
5
+ private audioLengthInBytes;
6
+ private tracks;
7
+ parse(): Promise<void>;
8
+ handleAtom(atom: Atom, remaining: number): Promise<void>;
9
+ private getTrackDescription;
10
+ private calculateBitRate;
11
+ private addTag;
12
+ private addWarning;
13
+ /**
14
+ * Parse data of Meta-item-list-atom (item of 'ilst' atom)
15
+ * @param metaAtom
16
+ * Ref: https://developer.apple.com/library/content/documentation/QuickTime/QTFF/Metadata/Metadata.html#//apple_ref/doc/uid/TP40000939-CH1-SW8
17
+ */
18
+ private parseMetadataItemData;
19
+ private parseValueAtom;
20
+ private atomParsers;
21
+ /**
22
+ * @param sampleDescription
23
+ * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html#//apple_ref/doc/uid/TP40000939-CH205-128916
24
+ */
25
+ private parseSoundSampleDescription;
26
+ private parseChapterTrack;
27
+ private findSampleOffset;
28
+ private getChunkDuration;
29
+ private getSamplesPerChunk;
30
+ }
@@ -0,0 +1,5 @@
1
+ import { CaseInsensitiveTagMap } from '../common/CaseInsensitiveTagMap.js';
2
+ export declare const tagType = "iTunes";
3
+ export declare class MP4TagMapper extends CaseInsensitiveTagMap {
4
+ constructor();
5
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Extended Lame Header
3
+ */
4
+ import { IGetToken } from 'strtok3/core';
5
+ import { IReplayGain } from './ReplayGainDataFormat.js';
6
+ /**
7
+ * LAME Tag, extends the Xing header format
8
+ * First added in LAME 3.12 for VBR
9
+ * The modified header is also included in CBR files (effective LAME 3.94), with "Info" instead of "XING" near the beginning.
10
+ */
11
+ export interface IExtendedLameHeader {
12
+ revision: number;
13
+ vbr_method: number;
14
+ lowpass_filter: number;
15
+ track_peak?: number;
16
+ track_gain: IReplayGain;
17
+ album_gain: IReplayGain;
18
+ music_length: number;
19
+ music_crc: number;
20
+ header_crc: number;
21
+ }
22
+ /**
23
+ * Info Tag
24
+ * @link http://gabriel.mp3-tech.org/mp3infotag.html
25
+ * @link https://github.com/quodlibet/mutagen/blob/abd58ee58772224334a18817c3fb31103572f70e/mutagen/mp3/_util.py#L112
26
+ */
27
+ export declare const ExtendedLameHeader: IGetToken<IExtendedLameHeader>;
@@ -0,0 +1,49 @@
1
+ import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
2
+ export declare class MpegParser extends AbstractID3Parser {
3
+ private frameCount;
4
+ private syncFrameCount;
5
+ private countSkipFrameData;
6
+ private totalDataLength;
7
+ private audioFrameHeader;
8
+ private bitrates;
9
+ private offset;
10
+ private frame_size;
11
+ private crc;
12
+ private calculateEofDuration;
13
+ private samplesPerFrame;
14
+ private buf_frame_header;
15
+ /**
16
+ * Number of bytes already parsed since beginning of stream / file
17
+ */
18
+ private mpegOffset;
19
+ private syncPeek;
20
+ /**
21
+ * Called after ID3 headers have been parsed
22
+ */
23
+ postId3v2Parse(): Promise<void>;
24
+ /**
25
+ * Called after file has been fully parsed, this allows, if present, to exclude the ID3v1.1 header length
26
+ */
27
+ protected finalize(): void;
28
+ private sync;
29
+ /**
30
+ * Combined ADTS & MPEG (MP2 & MP3) header handling
31
+ * @return {Promise<boolean>} true if parser should quit
32
+ */
33
+ private parseCommonMpegHeader;
34
+ /**
35
+ * @return {Promise<boolean>} true if parser should quit
36
+ */
37
+ private parseAudioFrameHeader;
38
+ private parseAdts;
39
+ private parseCrc;
40
+ private skipSideInformation;
41
+ private readXtraInfoHeader;
42
+ /**
43
+ * Ref: http://gabriel.mp3-tech.org/mp3infotag.html
44
+ * @returns {Promise<string>}
45
+ */
46
+ private readXingInfoHeader;
47
+ private skipFrameData;
48
+ private areAllSame;
49
+ }
@@ -0,0 +1,55 @@
1
+ import { IGetToken } from 'strtok3/core';
2
+ export interface IReplayGain {
3
+ type: NameCode;
4
+ origin: ReplayGainOriginator;
5
+ adjustment: number;
6
+ }
7
+ /**
8
+ * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#name-code
9
+ */
10
+ declare enum NameCode {
11
+ /**
12
+ * not set
13
+ */
14
+ not_set = 0,
15
+ /**
16
+ * Radio Gain Adjustment
17
+ */
18
+ radio = 1,
19
+ /**
20
+ * Audiophile Gain Adjustment
21
+ */
22
+ audiophile = 2
23
+ }
24
+ /**
25
+ * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#originator-code
26
+ */
27
+ declare enum ReplayGainOriginator {
28
+ /**
29
+ * Replay Gain unspecified
30
+ */
31
+ unspecified = 0,
32
+ /**
33
+ * Replay Gain pre-set by artist/producer/mastering engineer
34
+ */
35
+ engineer = 1,
36
+ /**
37
+ * Replay Gain set by user
38
+ */
39
+ user = 2,
40
+ /**
41
+ * Replay Gain determined automatically, as described on this site
42
+ */
43
+ automatic = 3,
44
+ /**
45
+ * Set by simple RMS average
46
+ */
47
+ rms_average = 4
48
+ }
49
+ /**
50
+ * Replay Gain Data Format
51
+ *
52
+ * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format
53
+ */
54
+ export declare const ReplayGain: IGetToken<IReplayGain>;
55
+ export {};
@@ -0,0 +1,45 @@
1
+ /// <reference types="node" resolution-mode="require"/>
2
+ import * as Token from 'token-types';
3
+ import { IGetToken, ITokenizer } from 'strtok3/core';
4
+ import { IExtendedLameHeader } from './ExtendedLameHeader.js';
5
+ export interface IXingHeaderFlags {
6
+ frames: boolean;
7
+ bytes: boolean;
8
+ toc: boolean;
9
+ vbrScale: boolean;
10
+ }
11
+ /**
12
+ * Info Tag: Xing, LAME
13
+ */
14
+ export declare const InfoTagHeaderTag: Token.StringType;
15
+ /**
16
+ * LAME TAG value
17
+ * Did not find any official documentation for this
18
+ * Value e.g.: "3.98.4"
19
+ */
20
+ export declare const LameEncoderVersion: Token.StringType;
21
+ export interface IXingInfoTag {
22
+ /**
23
+ * total bit stream frames from Vbr header data
24
+ */
25
+ numFrames?: number;
26
+ /**
27
+ * Actual stream size = file size - header(s) size [bytes]
28
+ */
29
+ streamSize?: number;
30
+ toc?: Buffer;
31
+ /**
32
+ * the number of header data bytes (from original file)
33
+ */
34
+ vbrScale?: number;
35
+ lame?: {
36
+ version: string;
37
+ extended?: IExtendedLameHeader;
38
+ };
39
+ }
40
+ /**
41
+ * Info Tag
42
+ * Ref: http://gabriel.mp3-tech.org/mp3infotag.html
43
+ */
44
+ export declare const XingHeaderFlags: IGetToken<IXingHeaderFlags>;
45
+ export declare function readXingHeader(tokenizer: ITokenizer): Promise<IXingInfoTag>;
@@ -0,0 +1,5 @@
1
+ import { AbstractID3Parser } from '../id3v2/AbstractID3Parser.js';
2
+ declare class MusepackParser extends AbstractID3Parser {
3
+ postId3v2Parse(): Promise<void>;
4
+ }
5
+ export default MusepackParser;
@@ -0,0 +1,13 @@
1
+ import { ITokenizer } from 'strtok3/core';
2
+ export declare class BitReader {
3
+ private tokenizer;
4
+ pos: number;
5
+ private dword;
6
+ constructor(tokenizer: ITokenizer);
7
+ /**
8
+ *
9
+ * @param bits 1..30 bits
10
+ */
11
+ read(bits: number): Promise<number>;
12
+ ignore(bits: number): Promise<number>;
13
+ }
@@ -0,0 +1,8 @@
1
+ import { BasicParser } from '../../common/BasicParser.js';
2
+ export declare class MpcSv7Parser extends BasicParser {
3
+ private bitreader;
4
+ private audioLength;
5
+ private duration;
6
+ parse(): Promise<void>;
7
+ private skipAudioData;
8
+ }
@@ -0,0 +1,28 @@
1
+ import { IGetToken } from 'strtok3/core';
2
+ /**
3
+ * MusePack stream version 7 format specification
4
+ * http://trac.musepack.net/musepack/wiki/SV7Specification
5
+ */
6
+ export interface IHeader {
7
+ signature: string;
8
+ streamMinorVersion: number;
9
+ streamMajorVersion: number;
10
+ frameCount: number;
11
+ intensityStereo: boolean;
12
+ midSideStereo: boolean;
13
+ maxBand: number;
14
+ profile: number;
15
+ link: number;
16
+ sampleFrequency: number;
17
+ maxLevel: number;
18
+ titleGain: number;
19
+ titlePeak: number;
20
+ albumGain: number;
21
+ albumPeak: number;
22
+ trueGapless: boolean;
23
+ lastFrameLength: number;
24
+ }
25
+ /**
26
+ * BASIC STRUCTURE
27
+ */
28
+ export declare const Header: IGetToken<IHeader>;
@@ -0,0 +1,6 @@
1
+ import { BasicParser } from '../../common/BasicParser.js';
2
+ export declare class MpcSv8Parser extends BasicParser {
3
+ private audioLength;
4
+ parse(): Promise<void>;
5
+ private parsePacket;
6
+ }