music-metadata 11.0.1 → 11.0.3

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 (62) hide show
  1. package/lib/ParserFactory.d.ts +2 -2
  2. package/lib/ParserFactory.js +2 -1
  3. package/lib/aiff/AiffLoader.js +2 -2
  4. package/lib/aiff/AiffToken.d.ts +1 -1
  5. package/lib/apev2/APEv2Token.d.ts +7 -6
  6. package/lib/apev2/APEv2Token.js +6 -7
  7. package/lib/apev2/Apev2Loader.js +2 -2
  8. package/lib/asf/AsfLoader.js +2 -2
  9. package/lib/asf/AsfObject.d.ts +11 -16
  10. package/lib/asf/AsfObject.js +8 -9
  11. package/lib/asf/GUID.d.ts +1 -1
  12. package/lib/common/GenericTagMapper.d.ts +2 -2
  13. package/lib/common/GenericTagTypes.d.ts +1 -1
  14. package/lib/common/GenericTagTypes.js +80 -76
  15. package/lib/common/MetadataCollector.d.ts +2 -2
  16. package/lib/common/MetadataCollector.js +3 -3
  17. package/lib/core.d.ts +5 -0
  18. package/lib/core.js +7 -0
  19. package/lib/dsdiff/DsdiffLoader.js +2 -2
  20. package/lib/dsf/DsfChunk.d.ts +10 -9
  21. package/lib/dsf/DsfChunk.js +9 -10
  22. package/lib/dsf/DsfLoader.js +2 -2
  23. package/lib/ebml/EbmlIterator.d.ts +9 -8
  24. package/lib/ebml/EbmlIterator.js +8 -9
  25. package/lib/ebml/types.d.ts +9 -8
  26. package/lib/ebml/types.js +8 -9
  27. package/lib/flac/FlacLoader.js +2 -2
  28. package/lib/flac/FlacParser.js +9 -10
  29. package/lib/id3v2/ID3v2Token.d.ts +39 -37
  30. package/lib/id3v2/ID3v2Token.js +37 -40
  31. package/lib/matroska/MatroskaLoader.js +2 -2
  32. package/lib/matroska/types.d.ts +22 -20
  33. package/lib/matroska/types.js +27 -20
  34. package/lib/mp4/Atom.d.ts +3 -3
  35. package/lib/mp4/AtomToken.d.ts +0 -4
  36. package/lib/mp4/AtomToken.js +1 -5
  37. package/lib/mp4/Mp4Loader.js +2 -2
  38. package/lib/mpeg/MpegLoader.js +2 -2
  39. package/lib/mpeg/ReplayGainDataFormat.d.ts +14 -12
  40. package/lib/mpeg/ReplayGainDataFormat.js +12 -14
  41. package/lib/musepack/MusepackLoader.js +2 -2
  42. package/lib/musepack/sv7/BitReader.d.ts +1 -1
  43. package/lib/musepack/sv7/BitReader.js +1 -1
  44. package/lib/musepack/sv8/MpcSv8Parser.js +1 -0
  45. package/lib/musepack/sv8/StreamVersion8.d.ts +4 -2
  46. package/lib/musepack/sv8/StreamVersion8.js +8 -2
  47. package/lib/ogg/OggLoader.js +2 -2
  48. package/lib/ogg/opus/Opus.js +1 -1
  49. package/lib/ogg/opus/OpusParser.d.ts +1 -1
  50. package/lib/ogg/opus/OpusParser.js +1 -1
  51. package/lib/ogg/vorbis/Vorbis.d.ts +1 -1
  52. package/lib/ogg/vorbis/VorbisParser.d.ts +1 -1
  53. package/lib/ogg/vorbis/VorbisParser.js +1 -1
  54. package/lib/riff/RiffChunk.d.ts +1 -1
  55. package/lib/type.d.ts +1 -1
  56. package/lib/type.js +1 -1
  57. package/lib/wav/WaveChunk.d.ts +31 -15
  58. package/lib/wav/WaveChunk.js +30 -16
  59. package/lib/wav/WaveLoader.js +2 -2
  60. package/lib/wav/WaveParser.js +1 -1
  61. package/lib/wavpack/WavPackLoader.js +2 -2
  62. package/package.json +7 -5
@@ -7,14 +7,13 @@ import { makeUnexpectedFileContentError } from '../ParseError.js';
7
7
  const debug = initDebug('music-metadata:parser:ebml');
8
8
  export class EbmlContentError extends makeUnexpectedFileContentError('EBML') {
9
9
  }
10
- export var ParseAction;
11
- (function (ParseAction) {
12
- ParseAction[ParseAction["ReadNext"] = 0] = "ReadNext";
13
- ParseAction[ParseAction["IgnoreElement"] = 2] = "IgnoreElement";
14
- ParseAction[ParseAction["SkipSiblings"] = 3] = "SkipSiblings";
15
- ParseAction[ParseAction["TerminateParsing"] = 4] = "TerminateParsing";
16
- ParseAction[ParseAction["SkipElement"] = 5] = "SkipElement"; // Consider the element has read, assume position is at the next element
17
- })(ParseAction || (ParseAction = {}));
10
+ export const ParseAction = {
11
+ ReadNext: 0, // Continue reading the next elements
12
+ IgnoreElement: 2, // Ignore (do not read) this element
13
+ SkipSiblings: 3, // Skip all remaining elements at the same level
14
+ TerminateParsing: 4, // Terminate the parsing process
15
+ SkipElement: 5 // Consider the element has read, assume position is at the next element
16
+ };
18
17
  /**
19
18
  * Extensible Binary Meta Language (EBML) iterator
20
19
  * https://en.wikipedia.org/wiki/Extensible_Binary_Meta_Language
@@ -28,11 +27,11 @@ export class EbmlIterator {
28
27
  * @param tokenizer
29
28
  */
30
29
  constructor(tokenizer) {
31
- this.tokenizer = tokenizer;
32
30
  this.padding = 0;
33
31
  this.parserMap = new Map();
34
32
  this.ebmlMaxIDLength = 4;
35
33
  this.ebmlMaxSizeLength = 8;
34
+ this.tokenizer = tokenizer;
36
35
  this.parserMap.set(DataType.uint, e => this.readUint(e));
37
36
  this.parserMap.set(DataType.string, e => this.readString(e));
38
37
  this.parserMap.set(DataType.binary, e => this.readBuffer(e));
@@ -1,14 +1,15 @@
1
1
  export interface ITree {
2
2
  [name: string]: string | number | boolean | Uint8Array | ITree | ITree[];
3
3
  }
4
- export declare enum DataType {
5
- 'string' = 0,
6
- uint = 1,
7
- uid = 2,
8
- bool = 3,
9
- binary = 4,
10
- float = 5
11
- }
4
+ export declare const DataType: {
5
+ readonly string: 0;
6
+ readonly uint: 1;
7
+ readonly uid: 2;
8
+ readonly bool: 3;
9
+ readonly binary: 4;
10
+ readonly float: 5;
11
+ };
12
+ export type DataType = typeof DataType[keyof typeof DataType];
12
13
  export type ValueType = string | number | Uint8Array | boolean | ITree | ITree[];
13
14
  export interface IHeader {
14
15
  id: number;
package/lib/ebml/types.js CHANGED
@@ -1,10 +1,9 @@
1
- export var DataType;
2
- (function (DataType) {
3
- DataType[DataType["string"] = 0] = "string";
4
- DataType[DataType["uint"] = 1] = "uint";
5
- DataType[DataType["uid"] = 2] = "uid";
6
- DataType[DataType["bool"] = 3] = "bool";
7
- DataType[DataType["binary"] = 4] = "binary";
8
- DataType[DataType["float"] = 5] = "float";
9
- })(DataType || (DataType = {}));
1
+ export const DataType = {
2
+ string: 0,
3
+ uint: 1,
4
+ uid: 2,
5
+ bool: 3,
6
+ binary: 4,
7
+ float: 5,
8
+ };
10
9
  //# sourceMappingURL=types.js.map
@@ -1,8 +1,8 @@
1
1
  export const flacParserLoader = {
2
2
  parserType: 'flac',
3
3
  extensions: ['.flac'],
4
- async load(metadata, tokenizer, options) {
5
- return new (await import('./FlacParser.js')).FlacParser(metadata, tokenizer, options);
4
+ async load() {
5
+ return (await import('./FlacParser.js')).FlacParser;
6
6
  }
7
7
  };
8
8
  //# sourceMappingURL=FlacLoader.js.map
@@ -14,16 +14,15 @@ class FlacContentError extends makeUnexpectedFileContentError('FLAC') {
14
14
  * FLAC supports up to 128 kinds of metadata blocks; currently the following are defined:
15
15
  * ref: https://xiph.org/flac/format.html#metadata_block
16
16
  */
17
- var BlockType;
18
- (function (BlockType) {
19
- BlockType[BlockType["STREAMINFO"] = 0] = "STREAMINFO";
20
- BlockType[BlockType["PADDING"] = 1] = "PADDING";
21
- BlockType[BlockType["APPLICATION"] = 2] = "APPLICATION";
22
- BlockType[BlockType["SEEKTABLE"] = 3] = "SEEKTABLE";
23
- BlockType[BlockType["VORBIS_COMMENT"] = 4] = "VORBIS_COMMENT";
24
- BlockType[BlockType["CUESHEET"] = 5] = "CUESHEET";
25
- BlockType[BlockType["PICTURE"] = 6] = "PICTURE";
26
- })(BlockType || (BlockType = {}));
17
+ const BlockType = {
18
+ STREAMINFO: 0, // STREAMINFO
19
+ PADDING: 1, // PADDING
20
+ APPLICATION: 2, // APPLICATION
21
+ SEEKTABLE: 3, // SEEKTABLE
22
+ VORBIS_COMMENT: 4, // VORBIS_COMMENT
23
+ CUESHEET: 5, // CUESHEET
24
+ PICTURE: 6 // PICTURE
25
+ };
27
26
  export class FlacParser extends AbstractID3Parser {
28
27
  constructor() {
29
28
  super(...arguments);
@@ -4,29 +4,29 @@ import * as util from '../common/Util.js';
4
4
  * The picture type according to the ID3v2 APIC frame
5
5
  * Ref: http://id3.org/id3v2.3.0#Attached_picture
6
6
  */
7
- export declare enum AttachedPictureType {
8
- 'Other' = 0,
9
- "32x32 pixels 'file icon' (PNG only)" = 1,
10
- 'Other file icon' = 2,
11
- 'Cover (front)' = 3,
12
- 'Cover (back)' = 4,
13
- 'Leaflet page' = 5,
14
- 'Media (e.g. label side of CD)' = 6,
15
- 'Lead artist/lead performer/soloist' = 7,
16
- 'Artist/performer' = 8,
17
- 'Conductor' = 9,
18
- 'Band/Orchestra' = 10,
19
- 'Composer' = 11,
20
- 'Lyricist/text writer' = 12,
21
- 'Recording Location' = 13,
22
- 'During recording' = 14,
23
- 'During performance' = 15,
24
- 'Movie/video screen capture' = 16,
25
- 'A bright coloured fish' = 17,
26
- 'Illustration' = 18,
27
- 'Band/artist logotype' = 19,
28
- 'Publisher/Studio logotype' = 20
29
- }
7
+ export declare const AttachedPictureType: {
8
+ 0: string;
9
+ 1: string;
10
+ 2: string;
11
+ 3: string;
12
+ 4: string;
13
+ 5: string;
14
+ 6: string;
15
+ 7: string;
16
+ 8: string;
17
+ 9: string;
18
+ 10: string;
19
+ 11: string;
20
+ 12: string;
21
+ 13: string;
22
+ 14: string;
23
+ 15: string;
24
+ 16: string;
25
+ 17: string;
26
+ 18: string;
27
+ 19: string;
28
+ 20: string;
29
+ };
30
30
  export type ID3v2MajorVersion = 2 | 3 | 4;
31
31
  export interface IExtendedHeader {
32
32
  size: number;
@@ -37,20 +37,22 @@ export interface IExtendedHeader {
37
37
  /**
38
38
  * https://id3.org/id3v2.3.0#Synchronised_lyrics.2Ftext
39
39
  */
40
- export declare enum LyricsContentType {
41
- other = 0,
42
- lyrics = 1,
43
- text = 2,
44
- movement_part = 3,
45
- events = 4,
46
- chord = 5,
47
- trivia_pop = 6
48
- }
49
- export declare enum TimestampFormat {
50
- notSynchronized0 = 0,
51
- mpegFrameNumber = 1,
52
- milliseconds = 2
53
- }
40
+ export declare const LyricsContentType: {
41
+ other: number;
42
+ lyrics: number;
43
+ text: number;
44
+ movement_part: number;
45
+ events: number;
46
+ chord: number;
47
+ trivia_pop: number;
48
+ };
49
+ export type LyricsContentType = typeof LyricsContentType[keyof typeof LyricsContentType];
50
+ export declare const TimestampFormat: {
51
+ notSynchronized0: number;
52
+ mpegFrameNumber: number;
53
+ milliseconds: number;
54
+ };
55
+ export type TimestampFormat = typeof TimestampFormat[keyof typeof TimestampFormat];
54
56
  /**
55
57
  * 28 bits (representing up to 256MB) integer, the msb is 0 to avoid 'false syncsignals'.
56
58
  * 4 * %0xxxxxxx
@@ -4,49 +4,46 @@ import * as util from '../common/Util.js';
4
4
  * The picture type according to the ID3v2 APIC frame
5
5
  * Ref: http://id3.org/id3v2.3.0#Attached_picture
6
6
  */
7
- export var AttachedPictureType;
8
- (function (AttachedPictureType) {
9
- AttachedPictureType[AttachedPictureType["Other"] = 0] = "Other";
10
- AttachedPictureType[AttachedPictureType["32x32 pixels 'file icon' (PNG only)"] = 1] = "32x32 pixels 'file icon' (PNG only)";
11
- AttachedPictureType[AttachedPictureType["Other file icon"] = 2] = "Other file icon";
12
- AttachedPictureType[AttachedPictureType["Cover (front)"] = 3] = "Cover (front)";
13
- AttachedPictureType[AttachedPictureType["Cover (back)"] = 4] = "Cover (back)";
14
- AttachedPictureType[AttachedPictureType["Leaflet page"] = 5] = "Leaflet page";
15
- AttachedPictureType[AttachedPictureType["Media (e.g. label side of CD)"] = 6] = "Media (e.g. label side of CD)";
16
- AttachedPictureType[AttachedPictureType["Lead artist/lead performer/soloist"] = 7] = "Lead artist/lead performer/soloist";
17
- AttachedPictureType[AttachedPictureType["Artist/performer"] = 8] = "Artist/performer";
18
- AttachedPictureType[AttachedPictureType["Conductor"] = 9] = "Conductor";
19
- AttachedPictureType[AttachedPictureType["Band/Orchestra"] = 10] = "Band/Orchestra";
20
- AttachedPictureType[AttachedPictureType["Composer"] = 11] = "Composer";
21
- AttachedPictureType[AttachedPictureType["Lyricist/text writer"] = 12] = "Lyricist/text writer";
22
- AttachedPictureType[AttachedPictureType["Recording Location"] = 13] = "Recording Location";
23
- AttachedPictureType[AttachedPictureType["During recording"] = 14] = "During recording";
24
- AttachedPictureType[AttachedPictureType["During performance"] = 15] = "During performance";
25
- AttachedPictureType[AttachedPictureType["Movie/video screen capture"] = 16] = "Movie/video screen capture";
26
- AttachedPictureType[AttachedPictureType["A bright coloured fish"] = 17] = "A bright coloured fish";
27
- AttachedPictureType[AttachedPictureType["Illustration"] = 18] = "Illustration";
28
- AttachedPictureType[AttachedPictureType["Band/artist logotype"] = 19] = "Band/artist logotype";
29
- AttachedPictureType[AttachedPictureType["Publisher/Studio logotype"] = 20] = "Publisher/Studio logotype";
30
- })(AttachedPictureType || (AttachedPictureType = {}));
7
+ export const AttachedPictureType = {
8
+ 0: 'Other',
9
+ 1: "32x32 pixels 'file icon' (PNG only)",
10
+ 2: 'Other file icon',
11
+ 3: 'Cover (front)',
12
+ 4: 'Cover (back)',
13
+ 5: 'Leaflet page',
14
+ 6: 'Media (e.g. label side of CD)',
15
+ 7: 'Lead artist/lead performer/soloist',
16
+ 8: 'Artist/performer',
17
+ 9: 'Conductor',
18
+ 10: 'Band/Orchestra',
19
+ 11: 'Composer',
20
+ 12: 'Lyricist/text writer',
21
+ 13: 'Recording Location',
22
+ 14: 'During recording',
23
+ 15: 'During performance',
24
+ 16: 'Movie/video screen capture',
25
+ 17: 'A bright coloured fish',
26
+ 18: 'Illustration',
27
+ 19: 'Band/artist logotype',
28
+ 20: 'Publisher/Studio logotype'
29
+ };
31
30
  /**
32
31
  * https://id3.org/id3v2.3.0#Synchronised_lyrics.2Ftext
33
32
  */
34
- export var LyricsContentType;
35
- (function (LyricsContentType) {
36
- LyricsContentType[LyricsContentType["other"] = 0] = "other";
37
- LyricsContentType[LyricsContentType["lyrics"] = 1] = "lyrics";
38
- LyricsContentType[LyricsContentType["text"] = 2] = "text";
39
- LyricsContentType[LyricsContentType["movement_part"] = 3] = "movement_part";
40
- LyricsContentType[LyricsContentType["events"] = 4] = "events";
41
- LyricsContentType[LyricsContentType["chord"] = 5] = "chord";
42
- LyricsContentType[LyricsContentType["trivia_pop"] = 6] = "trivia_pop";
43
- })(LyricsContentType || (LyricsContentType = {}));
44
- export var TimestampFormat;
45
- (function (TimestampFormat) {
46
- TimestampFormat[TimestampFormat["notSynchronized0"] = 0] = "notSynchronized0";
47
- TimestampFormat[TimestampFormat["mpegFrameNumber"] = 1] = "mpegFrameNumber";
48
- TimestampFormat[TimestampFormat["milliseconds"] = 2] = "milliseconds";
49
- })(TimestampFormat || (TimestampFormat = {}));
33
+ export const LyricsContentType = {
34
+ other: 0,
35
+ lyrics: 1,
36
+ text: 2,
37
+ movement_part: 3,
38
+ events: 4,
39
+ chord: 5,
40
+ trivia_pop: 6,
41
+ };
42
+ export const TimestampFormat = {
43
+ notSynchronized0: 0,
44
+ mpegFrameNumber: 1,
45
+ milliseconds: 2
46
+ };
50
47
  /**
51
48
  * 28 bits (representing up to 256MB) integer, the msb is 0 to avoid 'false syncsignals'.
52
49
  * 4 * %0xxxxxxx
@@ -1,8 +1,8 @@
1
1
  export const matroskaParserLoader = {
2
2
  parserType: 'matroska',
3
3
  extensions: ['.mka', '.mkv', '.mk3d', '.mks', 'webm'],
4
- async load(metadata, tokenizer, options) {
5
- return new (await import('./MatroskaParser.js')).MatroskaParser(metadata, tokenizer, options);
4
+ async load() {
5
+ return (await import('./MatroskaParser.js')).MatroskaParser;
6
6
  }
7
7
  };
8
8
  //# sourceMappingURL=MatroskaLoader.js.map
@@ -80,30 +80,32 @@ export interface ISimpleTag {
80
80
  language?: string;
81
81
  default?: boolean;
82
82
  }
83
- export declare enum TargetType {
84
- shot = 10,
85
- scene = 20,
86
- track = 30,
87
- part = 40,
88
- album = 50,
89
- edition = 60,
90
- collection = 70
91
- }
92
- export declare enum TrackType {
93
- video = 1,
94
- audio = 2,
95
- complex = 3,
96
- logo = 4,
97
- subtitle = 17,
98
- button = 18,
99
- control = 32
100
- }
101
- export type TrackTypeKey = keyof TrackType;
83
+ export declare const TargetType: {
84
+ 10: string;
85
+ 20: string;
86
+ 30: string;
87
+ 40: string;
88
+ 50: string;
89
+ 60: string;
90
+ 70: string;
91
+ };
92
+ export declare const TrackType: {
93
+ video: number;
94
+ audio: number;
95
+ complex: number;
96
+ logo: number;
97
+ subtitle: number;
98
+ button: number;
99
+ control: number;
100
+ };
101
+ export type TrackType = typeof TrackType[keyof typeof TrackType];
102
+ export type TrackTypeKey = keyof typeof TrackType;
103
+ export declare const TrackTypeValueToKeyMap: Record<TrackType, TrackTypeKey>;
102
104
  export interface ITarget {
103
105
  trackUID?: Uint8Array;
104
106
  chapterUID?: Uint8Array;
105
107
  attachmentUID?: Uint8Array;
106
- targetTypeValue?: TargetType;
108
+ targetTypeValue?: keyof typeof TargetType;
107
109
  targetType?: string;
108
110
  }
109
111
  export interface ITag {
@@ -1,21 +1,28 @@
1
- export var TargetType;
2
- (function (TargetType) {
3
- TargetType[TargetType["shot"] = 10] = "shot";
4
- TargetType[TargetType["scene"] = 20] = "scene";
5
- TargetType[TargetType["track"] = 30] = "track";
6
- TargetType[TargetType["part"] = 40] = "part";
7
- TargetType[TargetType["album"] = 50] = "album";
8
- TargetType[TargetType["edition"] = 60] = "edition";
9
- TargetType[TargetType["collection"] = 70] = "collection";
10
- })(TargetType || (TargetType = {}));
11
- export var TrackType;
12
- (function (TrackType) {
13
- TrackType[TrackType["video"] = 1] = "video";
14
- TrackType[TrackType["audio"] = 2] = "audio";
15
- TrackType[TrackType["complex"] = 3] = "complex";
16
- TrackType[TrackType["logo"] = 4] = "logo";
17
- TrackType[TrackType["subtitle"] = 17] = "subtitle";
18
- TrackType[TrackType["button"] = 18] = "button";
19
- TrackType[TrackType["control"] = 32] = "control";
20
- })(TrackType || (TrackType = {}));
1
+ export const TargetType = {
2
+ 10: 'shot',
3
+ 20: 'scene',
4
+ 30: 'track',
5
+ 40: 'part',
6
+ 50: 'album',
7
+ 60: 'edition',
8
+ 70: 'collection'
9
+ };
10
+ export const TrackType = {
11
+ video: 0x01,
12
+ audio: 0x02,
13
+ complex: 0x03,
14
+ logo: 0x04,
15
+ subtitle: 0x11,
16
+ button: 0x12,
17
+ control: 0x20
18
+ };
19
+ export const TrackTypeValueToKeyMap = {
20
+ [TrackType.video]: 'video',
21
+ [TrackType.audio]: 'audio',
22
+ [TrackType.complex]: 'complex',
23
+ [TrackType.logo]: 'logo',
24
+ [TrackType.subtitle]: 'subtitle',
25
+ [TrackType.button]: 'button',
26
+ [TrackType.control]: 'control'
27
+ };
21
28
  //# sourceMappingURL=types.js.map
package/lib/mp4/Atom.d.ts CHANGED
@@ -2,12 +2,12 @@ import * as AtomToken from './AtomToken.js';
2
2
  import type { ITokenizer } from 'strtok3';
3
3
  export type AtomDataHandler = (atom: Atom, remaining: number) => Promise<void>;
4
4
  export declare class Atom {
5
- readonly header: AtomToken.IAtomHeader;
6
- extended: boolean;
7
- readonly parent: Atom | null;
8
5
  static readAtom(tokenizer: ITokenizer, dataHandler: AtomDataHandler, parent: Atom | null, remaining: number): Promise<Atom>;
9
6
  readonly children: Atom[];
10
7
  readonly atomPath: string;
8
+ readonly header: AtomToken.IAtomHeader;
9
+ extended: boolean;
10
+ readonly parent: Atom | null;
11
11
  constructor(header: AtomToken.IAtomHeader, extended: boolean, parent: Atom | null);
12
12
  getHeaderLength(): number;
13
13
  getPayloadLength(remaining: number): number;
@@ -161,7 +161,6 @@ export interface IAtomMdhd extends IAtomMxhd {
161
161
  * - https://wiki.multimedia.cx/index.php/QuickTime_container#mdhd
162
162
  */
163
163
  export declare class MdhdAtom extends FixedLengthAtom implements IGetToken<IAtomMdhd> {
164
- len: number;
165
164
  constructor(len: number);
166
165
  get(buf: Uint8Array, off: number): IAtomMdhd;
167
166
  }
@@ -169,7 +168,6 @@ export declare class MdhdAtom extends FixedLengthAtom implements IGetToken<IAtom
169
168
  * Token: Movie Header Atom
170
169
  */
171
170
  export declare class MvhdAtom extends FixedLengthAtom implements IGetToken<IAtomMvhd> {
172
- len: number;
173
171
  constructor(len: number);
174
172
  get(buf: Uint8Array, off: number): IAtomMvhd;
175
173
  }
@@ -355,7 +353,6 @@ export declare const TimeToSampleToken: IGetToken<ITimeToSampleToken>;
355
353
  * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25696
356
354
  */
357
355
  export declare class SttsAtom extends SimpleTableAtom<ITimeToSampleToken> {
358
- len: number;
359
356
  constructor(len: number);
360
357
  }
361
358
  /**
@@ -372,7 +369,6 @@ export declare const SampleToChunkToken: IGetToken<ISampleToChunk>;
372
369
  * Ref: https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP40000939-CH204-25706
373
370
  */
374
371
  export declare class StscAtom extends SimpleTableAtom<ISampleToChunk> {
375
- len: number;
376
372
  constructor(len: number);
377
373
  }
378
374
  /**
@@ -67,13 +67,13 @@ export class FixedLengthAtom {
67
67
  * @param atomId Atom ID
68
68
  */
69
69
  constructor(len, expLen, atomId) {
70
- this.len = len;
71
70
  if (len < expLen) {
72
71
  throw new Mp4ContentError(`Atom ${atomId} expected to be ${expLen}, but specifies ${len} bytes long.`);
73
72
  }
74
73
  if (len > expLen) {
75
74
  debug(`Warning: atom ${atomId} expected to be ${expLen}, but was actually ${len} bytes long.`);
76
75
  }
76
+ this.len = len;
77
77
  }
78
78
  }
79
79
  /**
@@ -95,7 +95,6 @@ const SecondsSinceMacEpoch = {
95
95
  export class MdhdAtom extends FixedLengthAtom {
96
96
  constructor(len) {
97
97
  super(len, 24, 'mdhd');
98
- this.len = len;
99
98
  }
100
99
  get(buf, off) {
101
100
  return {
@@ -116,7 +115,6 @@ export class MdhdAtom extends FixedLengthAtom {
116
115
  export class MvhdAtom extends FixedLengthAtom {
117
116
  constructor(len) {
118
117
  super(len, 100, 'mvhd');
119
- this.len = len;
120
118
  }
121
119
  get(buf, off) {
122
120
  return {
@@ -315,7 +313,6 @@ export const TimeToSampleToken = {
315
313
  export class SttsAtom extends SimpleTableAtom {
316
314
  constructor(len) {
317
315
  super(len, TimeToSampleToken);
318
- this.len = len;
319
316
  }
320
317
  }
321
318
  export const SampleToChunkToken = {
@@ -335,7 +332,6 @@ export const SampleToChunkToken = {
335
332
  export class StscAtom extends SimpleTableAtom {
336
333
  constructor(len) {
337
334
  super(len, SampleToChunkToken);
338
- this.len = len;
339
335
  }
340
336
  }
341
337
  /**
@@ -1,8 +1,8 @@
1
1
  export const mp4ParserLoader = {
2
2
  parserType: 'mp4',
3
3
  extensions: ['.mp4', '.m4a', '.m4b', '.m4pa', 'm4v', 'm4r', '3gp'],
4
- async load(metadata, tokenizer, options) {
5
- return new (await import('./MP4Parser.js')).MP4Parser(metadata, tokenizer, options);
4
+ async load() {
5
+ return (await import('./MP4Parser.js')).MP4Parser;
6
6
  }
7
7
  };
8
8
  //# sourceMappingURL=Mp4Loader.js.map
@@ -1,8 +1,8 @@
1
1
  export const mpegParserLoader = {
2
2
  parserType: 'mpeg',
3
3
  extensions: ['.mp2', '.mp3', '.m2a', '.aac', 'aacp'],
4
- async load(metadata, tokenizer, options) {
5
- return new (await import('./MpegParser.js')).MpegParser(metadata, tokenizer, options);
4
+ async load() {
5
+ return (await import('./MpegParser.js')).MpegParser;
6
6
  }
7
7
  };
8
8
  //# sourceMappingURL=MpegLoader.js.map
@@ -7,45 +7,47 @@ export interface IReplayGain {
7
7
  /**
8
8
  * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#name-code
9
9
  */
10
- declare enum NameCode {
10
+ declare const NameCode: {
11
11
  /**
12
12
  * not set
13
13
  */
14
- not_set = 0,
14
+ not_set: number;
15
15
  /**
16
16
  * Radio Gain Adjustment
17
17
  */
18
- radio = 1,
18
+ radio: number;
19
19
  /**
20
20
  * Audiophile Gain Adjustment
21
21
  */
22
- audiophile = 2
23
- }
22
+ audiophile: number;
23
+ };
24
+ type NameCode = typeof NameCode[keyof typeof NameCode];
24
25
  /**
25
26
  * https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#originator-code
26
27
  */
27
- declare enum ReplayGainOriginator {
28
+ declare const ReplayGainOriginator: {
28
29
  /**
29
30
  * Replay Gain unspecified
30
31
  */
31
- unspecified = 0,
32
+ unspecified: number;
32
33
  /**
33
34
  * Replay Gain pre-set by artist/producer/mastering engineer
34
35
  */
35
- engineer = 1,
36
+ engineer: number;
36
37
  /**
37
38
  * Replay Gain set by user
38
39
  */
39
- user = 2,
40
+ user: number;
40
41
  /**
41
42
  * Replay Gain determined automatically, as described on this site
42
43
  */
43
- automatic = 3,
44
+ automatic: number;
44
45
  /**
45
46
  * Set by simple RMS average
46
47
  */
47
- rms_average = 4
48
- }
48
+ rms_average: number;
49
+ };
50
+ type ReplayGainOriginator = typeof ReplayGainOriginator[keyof typeof ReplayGainOriginator];
49
51
  /**
50
52
  * Replay Gain Data Format
51
53
  *