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.
- package/lib/ParserFactory.d.ts +2 -2
- package/lib/ParserFactory.js +2 -1
- package/lib/aiff/AiffLoader.js +2 -2
- package/lib/aiff/AiffToken.d.ts +1 -1
- package/lib/apev2/APEv2Token.d.ts +7 -6
- package/lib/apev2/APEv2Token.js +6 -7
- package/lib/apev2/Apev2Loader.js +2 -2
- package/lib/asf/AsfLoader.js +2 -2
- package/lib/asf/AsfObject.d.ts +11 -16
- package/lib/asf/AsfObject.js +8 -9
- package/lib/asf/GUID.d.ts +1 -1
- package/lib/common/GenericTagMapper.d.ts +2 -2
- package/lib/common/GenericTagTypes.d.ts +1 -1
- package/lib/common/GenericTagTypes.js +80 -76
- package/lib/common/MetadataCollector.d.ts +2 -2
- package/lib/common/MetadataCollector.js +3 -3
- package/lib/core.d.ts +5 -0
- package/lib/core.js +7 -0
- package/lib/dsdiff/DsdiffLoader.js +2 -2
- package/lib/dsf/DsfChunk.d.ts +10 -9
- package/lib/dsf/DsfChunk.js +9 -10
- package/lib/dsf/DsfLoader.js +2 -2
- package/lib/ebml/EbmlIterator.d.ts +9 -8
- package/lib/ebml/EbmlIterator.js +8 -9
- package/lib/ebml/types.d.ts +9 -8
- package/lib/ebml/types.js +8 -9
- package/lib/flac/FlacLoader.js +2 -2
- package/lib/flac/FlacParser.js +9 -10
- package/lib/id3v2/ID3v2Token.d.ts +39 -37
- package/lib/id3v2/ID3v2Token.js +37 -40
- package/lib/matroska/MatroskaLoader.js +2 -2
- package/lib/matroska/types.d.ts +22 -20
- package/lib/matroska/types.js +27 -20
- package/lib/mp4/Atom.d.ts +3 -3
- package/lib/mp4/AtomToken.d.ts +0 -4
- package/lib/mp4/AtomToken.js +1 -5
- package/lib/mp4/Mp4Loader.js +2 -2
- package/lib/mpeg/MpegLoader.js +2 -2
- package/lib/mpeg/ReplayGainDataFormat.d.ts +14 -12
- package/lib/mpeg/ReplayGainDataFormat.js +12 -14
- package/lib/musepack/MusepackLoader.js +2 -2
- package/lib/musepack/sv7/BitReader.d.ts +1 -1
- package/lib/musepack/sv7/BitReader.js +1 -1
- package/lib/musepack/sv8/MpcSv8Parser.js +1 -0
- package/lib/musepack/sv8/StreamVersion8.d.ts +4 -2
- package/lib/musepack/sv8/StreamVersion8.js +8 -2
- package/lib/ogg/OggLoader.js +2 -2
- package/lib/ogg/opus/Opus.js +1 -1
- package/lib/ogg/opus/OpusParser.d.ts +1 -1
- package/lib/ogg/opus/OpusParser.js +1 -1
- package/lib/ogg/vorbis/Vorbis.d.ts +1 -1
- package/lib/ogg/vorbis/VorbisParser.d.ts +1 -1
- package/lib/ogg/vorbis/VorbisParser.js +1 -1
- package/lib/riff/RiffChunk.d.ts +1 -1
- package/lib/type.d.ts +1 -1
- package/lib/type.js +1 -1
- package/lib/wav/WaveChunk.d.ts +31 -15
- package/lib/wav/WaveChunk.js +30 -16
- package/lib/wav/WaveLoader.js +2 -2
- package/lib/wav/WaveParser.js +1 -1
- package/lib/wavpack/WavPackLoader.js +2 -2
- package/package.json +7 -5
package/lib/ebml/EbmlIterator.js
CHANGED
|
@@ -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
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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));
|
package/lib/ebml/types.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
export interface ITree {
|
|
2
2
|
[name: string]: string | number | boolean | Uint8Array | ITree | ITree[];
|
|
3
3
|
}
|
|
4
|
-
export declare
|
|
5
|
-
|
|
6
|
-
uint
|
|
7
|
-
uid
|
|
8
|
-
bool
|
|
9
|
-
binary
|
|
10
|
-
float
|
|
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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
package/lib/flac/FlacLoader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const flacParserLoader = {
|
|
2
2
|
parserType: 'flac',
|
|
3
3
|
extensions: ['.flac'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./FlacParser.js')).FlacParser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=FlacLoader.js.map
|
package/lib/flac/FlacParser.js
CHANGED
|
@@ -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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
|
41
|
-
other
|
|
42
|
-
lyrics
|
|
43
|
-
text
|
|
44
|
-
movement_part
|
|
45
|
-
events
|
|
46
|
-
chord
|
|
47
|
-
trivia_pop
|
|
48
|
-
}
|
|
49
|
-
export
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
package/lib/id3v2/ID3v2Token.js
CHANGED
|
@@ -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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./MatroskaParser.js')).MatroskaParser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=MatroskaLoader.js.map
|
package/lib/matroska/types.d.ts
CHANGED
|
@@ -80,30 +80,32 @@ export interface ISimpleTag {
|
|
|
80
80
|
language?: string;
|
|
81
81
|
default?: boolean;
|
|
82
82
|
}
|
|
83
|
-
export declare
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
export declare
|
|
93
|
-
video
|
|
94
|
-
audio
|
|
95
|
-
complex
|
|
96
|
-
logo
|
|
97
|
-
subtitle
|
|
98
|
-
button
|
|
99
|
-
control
|
|
100
|
-
}
|
|
101
|
-
export type
|
|
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 {
|
package/lib/matroska/types.js
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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;
|
package/lib/mp4/AtomToken.d.ts
CHANGED
|
@@ -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
|
/**
|
package/lib/mp4/AtomToken.js
CHANGED
|
@@ -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
|
/**
|
package/lib/mp4/Mp4Loader.js
CHANGED
|
@@ -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(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./MP4Parser.js')).MP4Parser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=Mp4Loader.js.map
|
package/lib/mpeg/MpegLoader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const mpegParserLoader = {
|
|
2
2
|
parserType: 'mpeg',
|
|
3
3
|
extensions: ['.mp2', '.mp3', '.m2a', '.aac', 'aacp'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
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
|
|
10
|
+
declare const NameCode: {
|
|
11
11
|
/**
|
|
12
12
|
* not set
|
|
13
13
|
*/
|
|
14
|
-
not_set
|
|
14
|
+
not_set: number;
|
|
15
15
|
/**
|
|
16
16
|
* Radio Gain Adjustment
|
|
17
17
|
*/
|
|
18
|
-
radio
|
|
18
|
+
radio: number;
|
|
19
19
|
/**
|
|
20
20
|
* Audiophile Gain Adjustment
|
|
21
21
|
*/
|
|
22
|
-
audiophile
|
|
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
|
|
28
|
+
declare const ReplayGainOriginator: {
|
|
28
29
|
/**
|
|
29
30
|
* Replay Gain unspecified
|
|
30
31
|
*/
|
|
31
|
-
unspecified
|
|
32
|
+
unspecified: number;
|
|
32
33
|
/**
|
|
33
34
|
* Replay Gain pre-set by artist/producer/mastering engineer
|
|
34
35
|
*/
|
|
35
|
-
engineer
|
|
36
|
+
engineer: number;
|
|
36
37
|
/**
|
|
37
38
|
* Replay Gain set by user
|
|
38
39
|
*/
|
|
39
|
-
user
|
|
40
|
+
user: number;
|
|
40
41
|
/**
|
|
41
42
|
* Replay Gain determined automatically, as described on this site
|
|
42
43
|
*/
|
|
43
|
-
automatic
|
|
44
|
+
automatic: number;
|
|
44
45
|
/**
|
|
45
46
|
* Set by simple RMS average
|
|
46
47
|
*/
|
|
47
|
-
rms_average
|
|
48
|
-
}
|
|
48
|
+
rms_average: number;
|
|
49
|
+
};
|
|
50
|
+
type ReplayGainOriginator = typeof ReplayGainOriginator[keyof typeof ReplayGainOriginator];
|
|
49
51
|
/**
|
|
50
52
|
* Replay Gain Data Format
|
|
51
53
|
*
|