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/ParserFactory.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export interface IParserLoader {
|
|
|
9
9
|
extensions: string[];
|
|
10
10
|
parserType: ParserType;
|
|
11
11
|
/**
|
|
12
|
-
* Lazy load the parser
|
|
12
|
+
* Lazy load the parser implementation class.
|
|
13
13
|
*/
|
|
14
|
-
load(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions)
|
|
14
|
+
load(): Promise<new (metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions) => ITokenParser>;
|
|
15
15
|
}
|
|
16
16
|
export interface ITokenParser {
|
|
17
17
|
/**
|
package/lib/ParserFactory.js
CHANGED
|
@@ -85,7 +85,8 @@ export class ParserFactory {
|
|
|
85
85
|
// Parser found, execute parser
|
|
86
86
|
debug(`Loading ${parserLoader.parserType} parser...`);
|
|
87
87
|
const metadata = new MetadataCollector(opts);
|
|
88
|
-
const
|
|
88
|
+
const ParserImpl = await parserLoader.load();
|
|
89
|
+
const parser = new ParserImpl(metadata, tokenizer, opts ?? {});
|
|
89
90
|
debug(`Parser ${parserLoader.parserType} loaded`);
|
|
90
91
|
await parser.parse();
|
|
91
92
|
return metadata.toCommonMetadata();
|
package/lib/aiff/AiffLoader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const aiffParserLoader = {
|
|
2
2
|
parserType: 'aiff',
|
|
3
3
|
extensions: ['.aif', 'aiff', 'aifc'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./AiffParser.js')).AIFFParser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=AiffLoader.js.map
|
package/lib/aiff/AiffToken.d.ts
CHANGED
|
@@ -40,8 +40,8 @@ export interface ICommon {
|
|
|
40
40
|
compressionName?: string;
|
|
41
41
|
}
|
|
42
42
|
export declare class Common implements IGetToken<ICommon> {
|
|
43
|
-
private isAifc;
|
|
44
43
|
len: number;
|
|
44
|
+
private isAifc;
|
|
45
45
|
constructor(header: iff.IChunkHeader, isAifc: boolean);
|
|
46
46
|
get(buf: Uint8Array, off: number): ICommon;
|
|
47
47
|
}
|
|
@@ -52,12 +52,13 @@ export interface IFooter {
|
|
|
52
52
|
fields: number;
|
|
53
53
|
flags: ITagFlags;
|
|
54
54
|
}
|
|
55
|
-
export declare
|
|
56
|
-
text_utf8
|
|
57
|
-
binary
|
|
58
|
-
external_info
|
|
59
|
-
reserved
|
|
60
|
-
}
|
|
55
|
+
export declare const DataType: {
|
|
56
|
+
text_utf8: number;
|
|
57
|
+
binary: number;
|
|
58
|
+
external_info: number;
|
|
59
|
+
reserved: number;
|
|
60
|
+
};
|
|
61
|
+
export type DataType = typeof DataType[keyof typeof DataType];
|
|
61
62
|
/**
|
|
62
63
|
* APE_DESCRIPTOR: defines the sizes (and offsets) of all the pieces, as well as the MD5 checksum
|
|
63
64
|
*/
|
package/lib/apev2/APEv2Token.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as Token from 'token-types';
|
|
2
2
|
import { FourCcToken } from '../common/FourCC.js';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(DataType || (DataType = {}));
|
|
3
|
+
export const DataType = {
|
|
4
|
+
text_utf8: 0,
|
|
5
|
+
binary: 1,
|
|
6
|
+
external_info: 2,
|
|
7
|
+
reserved: 3
|
|
8
|
+
};
|
|
10
9
|
/**
|
|
11
10
|
* APE_DESCRIPTOR: defines the sizes (and offsets) of all the pieces, as well as the MD5 checksum
|
|
12
11
|
*/
|
package/lib/apev2/Apev2Loader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const apeParserLoader = {
|
|
2
2
|
parserType: 'apev2',
|
|
3
3
|
extensions: ['.ape'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./APEv2Parser.js')).APEv2Parser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=Apev2Loader.js.map
|
package/lib/asf/AsfLoader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const asfParserLoader = {
|
|
2
2
|
parserType: 'asf',
|
|
3
3
|
extensions: ['.asf'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./AsfParser.js')).AsfParser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=AsfLoader.js.map
|
package/lib/asf/AsfObject.d.ts
CHANGED
|
@@ -10,13 +10,7 @@ declare const AsfContentParseError_base: {
|
|
|
10
10
|
stack?: string;
|
|
11
11
|
};
|
|
12
12
|
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
13
|
-
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite
|
|
14
|
-
* Specifies the amount of time to buffer data before starting to play the file, in millisecond units.
|
|
15
|
-
* If this value is nonzero, the Play Duration field and all of the payload Presentation Time fields have been offset
|
|
16
|
-
* by this amount. Therefore, player software must subtract the value in the preroll field from the play duration and
|
|
17
|
-
* presentation times to calculate their actual values. It follows that all payload Presentation Time fields need to
|
|
18
|
-
* be at least this value.
|
|
19
|
-
*/[]) => any) | undefined;
|
|
13
|
+
prepareStackTrace?: ((err: Error, stackTraces: NodeJS.CallSite[]) => any) | undefined;
|
|
20
14
|
stackTraceLimit: number;
|
|
21
15
|
};
|
|
22
16
|
export declare class AsfContentParseError extends AsfContentParseError_base {
|
|
@@ -24,32 +18,33 @@ export declare class AsfContentParseError extends AsfContentParseError_base {
|
|
|
24
18
|
/**
|
|
25
19
|
* Data Type: Specifies the type of information being stored. The following values are recognized.
|
|
26
20
|
*/
|
|
27
|
-
export declare
|
|
21
|
+
export declare const DataType: {
|
|
28
22
|
/**
|
|
29
23
|
* Unicode string. The data consists of a sequence of Unicode characters.
|
|
30
24
|
*/
|
|
31
|
-
UnicodeString
|
|
25
|
+
UnicodeString: number;
|
|
32
26
|
/**
|
|
33
27
|
* BYTE array. The type of data is implementation-specific.
|
|
34
28
|
*/
|
|
35
|
-
ByteArray
|
|
29
|
+
ByteArray: number;
|
|
36
30
|
/**
|
|
37
31
|
* BOOL. The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values.
|
|
38
32
|
*/
|
|
39
|
-
Bool
|
|
33
|
+
Bool: number;
|
|
40
34
|
/**
|
|
41
35
|
* DWORD. The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer.
|
|
42
36
|
*/
|
|
43
|
-
DWord
|
|
37
|
+
DWord: number;
|
|
44
38
|
/**
|
|
45
39
|
* QWORD. The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer.
|
|
46
40
|
*/
|
|
47
|
-
QWord
|
|
41
|
+
QWord: number;
|
|
48
42
|
/**
|
|
49
43
|
* WORD. The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer.
|
|
50
44
|
*/
|
|
51
|
-
Word
|
|
52
|
-
}
|
|
45
|
+
Word: number;
|
|
46
|
+
};
|
|
47
|
+
export type DataType = typeof DataType[keyof typeof DataType];
|
|
53
48
|
/**
|
|
54
49
|
* Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575
|
|
55
50
|
*/
|
|
@@ -322,8 +317,8 @@ export interface IWmPicture extends IPicture {
|
|
|
322
317
|
* Ref: https://msdn.microsoft.com/en-us/library/windows/desktop/dd757977(v=vs.85).aspx
|
|
323
318
|
*/
|
|
324
319
|
export declare class WmPictureToken implements IGetToken<IWmPicture> {
|
|
325
|
-
len: number;
|
|
326
320
|
static fromBuffer(buffer: Uint8Array): IWmPicture;
|
|
321
|
+
len: number;
|
|
327
322
|
constructor(len: number);
|
|
328
323
|
get(buffer: Uint8Array, offset: number): IWmPicture;
|
|
329
324
|
}
|
package/lib/asf/AsfObject.js
CHANGED
|
@@ -10,33 +10,32 @@ export class AsfContentParseError extends makeUnexpectedFileContentError('ASF')
|
|
|
10
10
|
/**
|
|
11
11
|
* Data Type: Specifies the type of information being stored. The following values are recognized.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
14
|
-
(function (DataType) {
|
|
13
|
+
export const DataType = {
|
|
15
14
|
/**
|
|
16
15
|
* Unicode string. The data consists of a sequence of Unicode characters.
|
|
17
16
|
*/
|
|
18
|
-
|
|
17
|
+
UnicodeString: 0,
|
|
19
18
|
/**
|
|
20
19
|
* BYTE array. The type of data is implementation-specific.
|
|
21
20
|
*/
|
|
22
|
-
|
|
21
|
+
ByteArray: 1,
|
|
23
22
|
/**
|
|
24
23
|
* BOOL. The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer. Only 0x0000 or 0x0001 are permitted values.
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
Bool: 2,
|
|
27
26
|
/**
|
|
28
27
|
* DWORD. The data is 4 bytes long and should be interpreted as a 32-bit unsigned integer.
|
|
29
28
|
*/
|
|
30
|
-
|
|
29
|
+
DWord: 3,
|
|
31
30
|
/**
|
|
32
31
|
* QWORD. The data is 8 bytes long and should be interpreted as a 64-bit unsigned integer.
|
|
33
32
|
*/
|
|
34
|
-
|
|
33
|
+
QWord: 4,
|
|
35
34
|
/**
|
|
36
35
|
* WORD. The data is 2 bytes long and should be interpreted as a 16-bit unsigned integer.
|
|
37
36
|
*/
|
|
38
|
-
|
|
39
|
-
}
|
|
37
|
+
Word: 5
|
|
38
|
+
};
|
|
40
39
|
/**
|
|
41
40
|
* Token for: 3. ASF top-level Header Object
|
|
42
41
|
* Ref: http://drang.s4.xrea.com/program/tips/id3tag/wmp/03_asf_top_level_header_object.html#3
|
package/lib/asf/GUID.d.ts
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
* - https://github.com/dji-sdk/FFmpeg/blob/master/libavformat/asf.c
|
|
14
14
|
*/
|
|
15
15
|
export default class GUID {
|
|
16
|
-
str: string;
|
|
17
16
|
static HeaderObject: GUID;
|
|
18
17
|
static DataObject: GUID;
|
|
19
18
|
static SimpleIndexObject: GUID;
|
|
@@ -77,6 +76,7 @@ export default class GUID {
|
|
|
77
76
|
* @returns Encoded Binary GUID
|
|
78
77
|
*/
|
|
79
78
|
static encode(str: string): Uint8Array;
|
|
79
|
+
str: string;
|
|
80
80
|
constructor(str: string);
|
|
81
81
|
equals(guid: GUID): boolean;
|
|
82
82
|
toBin(): Uint8Array;
|
|
@@ -19,14 +19,14 @@ export interface IGenericTagMapper {
|
|
|
19
19
|
mapGenericTag(tag: ITag, warnings: INativeMetadataCollector): generic.IGenericTag | null;
|
|
20
20
|
}
|
|
21
21
|
export declare class CommonTagMapper implements IGenericTagMapper {
|
|
22
|
-
tagTypes: generic.TagType[];
|
|
23
|
-
tagMap: generic.INativeTagMap;
|
|
24
22
|
static maxRatingScore: number;
|
|
25
23
|
static toIntOrNull(str: string): number | null;
|
|
26
24
|
static normalizeTrack(origVal: number | string): {
|
|
27
25
|
no: number | null;
|
|
28
26
|
of: number | null;
|
|
29
27
|
};
|
|
28
|
+
tagTypes: generic.TagType[];
|
|
29
|
+
tagMap: generic.INativeTagMap;
|
|
30
30
|
constructor(tagTypes: generic.TagType[], tagMap: generic.INativeTagMap);
|
|
31
31
|
/**
|
|
32
32
|
* Process and set common tags
|
|
@@ -21,7 +21,7 @@ export interface ITagInfo {
|
|
|
21
21
|
export interface ITagInfoMap {
|
|
22
22
|
[index: string]: ITagInfo;
|
|
23
23
|
}
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const commonTagsKeys: (keyof ICommonTagsResult)[];
|
|
25
25
|
/**
|
|
26
26
|
* @param alias Name of common tag
|
|
27
27
|
* @returns {boolean|*} true if given alias is mapped as a singleton', otherwise false
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
const defaultTagInfo = {
|
|
2
|
+
multiple: false,
|
|
3
|
+
};
|
|
4
|
+
const commonTags = {
|
|
5
|
+
year: defaultTagInfo,
|
|
6
|
+
track: defaultTagInfo,
|
|
7
|
+
disk: defaultTagInfo,
|
|
8
|
+
title: defaultTagInfo,
|
|
9
|
+
artist: defaultTagInfo,
|
|
7
10
|
artists: { multiple: true, unique: true },
|
|
8
|
-
albumartist:
|
|
9
|
-
album:
|
|
10
|
-
date:
|
|
11
|
-
originaldate:
|
|
12
|
-
originalyear:
|
|
13
|
-
releasedate:
|
|
11
|
+
albumartist: defaultTagInfo,
|
|
12
|
+
album: defaultTagInfo,
|
|
13
|
+
date: defaultTagInfo,
|
|
14
|
+
originaldate: defaultTagInfo,
|
|
15
|
+
originalyear: defaultTagInfo,
|
|
16
|
+
releasedate: defaultTagInfo,
|
|
14
17
|
comment: { multiple: true, unique: false },
|
|
15
18
|
genre: { multiple: true, unique: true },
|
|
16
19
|
picture: { multiple: true, unique: true },
|
|
@@ -33,84 +36,85 @@ export const commonTags = {
|
|
|
33
36
|
djmixer: { multiple: true, unique: true },
|
|
34
37
|
mixer: { multiple: true, unique: true },
|
|
35
38
|
label: { multiple: true, unique: true },
|
|
36
|
-
grouping:
|
|
39
|
+
grouping: defaultTagInfo,
|
|
37
40
|
subtitle: { multiple: true },
|
|
38
|
-
discsubtitle:
|
|
39
|
-
totaltracks:
|
|
40
|
-
totaldiscs:
|
|
41
|
-
compilation:
|
|
41
|
+
discsubtitle: defaultTagInfo,
|
|
42
|
+
totaltracks: defaultTagInfo,
|
|
43
|
+
totaldiscs: defaultTagInfo,
|
|
44
|
+
compilation: defaultTagInfo,
|
|
42
45
|
rating: { multiple: true },
|
|
43
|
-
bpm:
|
|
44
|
-
mood:
|
|
45
|
-
media:
|
|
46
|
+
bpm: defaultTagInfo,
|
|
47
|
+
mood: defaultTagInfo,
|
|
48
|
+
media: defaultTagInfo,
|
|
46
49
|
catalognumber: { multiple: true, unique: true },
|
|
47
|
-
tvShow:
|
|
48
|
-
tvShowSort:
|
|
49
|
-
tvSeason:
|
|
50
|
-
tvEpisode:
|
|
51
|
-
tvEpisodeId:
|
|
52
|
-
tvNetwork:
|
|
53
|
-
podcast:
|
|
54
|
-
podcasturl:
|
|
55
|
-
releasestatus:
|
|
50
|
+
tvShow: defaultTagInfo,
|
|
51
|
+
tvShowSort: defaultTagInfo,
|
|
52
|
+
tvSeason: defaultTagInfo,
|
|
53
|
+
tvEpisode: defaultTagInfo,
|
|
54
|
+
tvEpisodeId: defaultTagInfo,
|
|
55
|
+
tvNetwork: defaultTagInfo,
|
|
56
|
+
podcast: defaultTagInfo,
|
|
57
|
+
podcasturl: defaultTagInfo,
|
|
58
|
+
releasestatus: defaultTagInfo,
|
|
56
59
|
releasetype: { multiple: true },
|
|
57
|
-
releasecountry:
|
|
58
|
-
script:
|
|
59
|
-
language:
|
|
60
|
-
copyright:
|
|
61
|
-
license:
|
|
62
|
-
encodedby:
|
|
63
|
-
encodersettings:
|
|
64
|
-
gapless:
|
|
65
|
-
barcode:
|
|
60
|
+
releasecountry: defaultTagInfo,
|
|
61
|
+
script: defaultTagInfo,
|
|
62
|
+
language: defaultTagInfo,
|
|
63
|
+
copyright: defaultTagInfo,
|
|
64
|
+
license: defaultTagInfo,
|
|
65
|
+
encodedby: defaultTagInfo,
|
|
66
|
+
encodersettings: defaultTagInfo,
|
|
67
|
+
gapless: defaultTagInfo,
|
|
68
|
+
barcode: defaultTagInfo,
|
|
66
69
|
isrc: { multiple: true },
|
|
67
|
-
asin:
|
|
68
|
-
musicbrainz_recordingid:
|
|
69
|
-
musicbrainz_trackid:
|
|
70
|
-
musicbrainz_albumid:
|
|
70
|
+
asin: defaultTagInfo,
|
|
71
|
+
musicbrainz_recordingid: defaultTagInfo,
|
|
72
|
+
musicbrainz_trackid: defaultTagInfo,
|
|
73
|
+
musicbrainz_albumid: defaultTagInfo,
|
|
71
74
|
musicbrainz_artistid: { multiple: true },
|
|
72
75
|
musicbrainz_albumartistid: { multiple: true },
|
|
73
|
-
musicbrainz_releasegroupid:
|
|
74
|
-
musicbrainz_workid:
|
|
75
|
-
musicbrainz_trmid:
|
|
76
|
-
musicbrainz_discid:
|
|
77
|
-
acoustid_id:
|
|
78
|
-
acoustid_fingerprint:
|
|
79
|
-
musicip_puid:
|
|
80
|
-
musicip_fingerprint:
|
|
81
|
-
website:
|
|
76
|
+
musicbrainz_releasegroupid: defaultTagInfo,
|
|
77
|
+
musicbrainz_workid: defaultTagInfo,
|
|
78
|
+
musicbrainz_trmid: defaultTagInfo,
|
|
79
|
+
musicbrainz_discid: defaultTagInfo,
|
|
80
|
+
acoustid_id: defaultTagInfo,
|
|
81
|
+
acoustid_fingerprint: defaultTagInfo,
|
|
82
|
+
musicip_puid: defaultTagInfo,
|
|
83
|
+
musicip_fingerprint: defaultTagInfo,
|
|
84
|
+
website: defaultTagInfo,
|
|
82
85
|
'performer:instrument': { multiple: true, unique: true },
|
|
83
|
-
averageLevel:
|
|
84
|
-
peakLevel:
|
|
86
|
+
averageLevel: defaultTagInfo,
|
|
87
|
+
peakLevel: defaultTagInfo,
|
|
85
88
|
notes: { multiple: true, unique: false },
|
|
86
|
-
key:
|
|
87
|
-
originalalbum:
|
|
88
|
-
originalartist:
|
|
89
|
+
key: defaultTagInfo,
|
|
90
|
+
originalalbum: defaultTagInfo,
|
|
91
|
+
originalartist: defaultTagInfo,
|
|
89
92
|
discogs_artist_id: { multiple: true, unique: true },
|
|
90
|
-
discogs_release_id:
|
|
91
|
-
discogs_label_id:
|
|
92
|
-
discogs_master_release_id:
|
|
93
|
-
discogs_votes:
|
|
94
|
-
discogs_rating:
|
|
95
|
-
replaygain_track_peak:
|
|
96
|
-
replaygain_track_gain:
|
|
97
|
-
replaygain_album_peak:
|
|
98
|
-
replaygain_album_gain:
|
|
99
|
-
replaygain_track_minmax:
|
|
100
|
-
replaygain_album_minmax:
|
|
101
|
-
replaygain_undo:
|
|
93
|
+
discogs_release_id: defaultTagInfo,
|
|
94
|
+
discogs_label_id: defaultTagInfo,
|
|
95
|
+
discogs_master_release_id: defaultTagInfo,
|
|
96
|
+
discogs_votes: defaultTagInfo,
|
|
97
|
+
discogs_rating: defaultTagInfo,
|
|
98
|
+
replaygain_track_peak: defaultTagInfo,
|
|
99
|
+
replaygain_track_gain: defaultTagInfo,
|
|
100
|
+
replaygain_album_peak: defaultTagInfo,
|
|
101
|
+
replaygain_album_gain: defaultTagInfo,
|
|
102
|
+
replaygain_track_minmax: defaultTagInfo,
|
|
103
|
+
replaygain_album_minmax: defaultTagInfo,
|
|
104
|
+
replaygain_undo: defaultTagInfo,
|
|
102
105
|
description: { multiple: true },
|
|
103
|
-
longDescription:
|
|
106
|
+
longDescription: defaultTagInfo,
|
|
104
107
|
category: { multiple: true },
|
|
105
|
-
hdVideo:
|
|
108
|
+
hdVideo: defaultTagInfo,
|
|
106
109
|
keywords: { multiple: true },
|
|
107
|
-
movement:
|
|
108
|
-
movementIndex:
|
|
109
|
-
movementTotal:
|
|
110
|
-
podcastId:
|
|
111
|
-
showMovement:
|
|
112
|
-
stik:
|
|
110
|
+
movement: defaultTagInfo,
|
|
111
|
+
movementIndex: defaultTagInfo,
|
|
112
|
+
movementTotal: defaultTagInfo,
|
|
113
|
+
podcastId: defaultTagInfo,
|
|
114
|
+
showMovement: defaultTagInfo,
|
|
115
|
+
stik: defaultTagInfo
|
|
113
116
|
};
|
|
117
|
+
export const commonTagsKeys = /* @__PURE__ */ Object.keys(commonTags);
|
|
114
118
|
/**
|
|
115
119
|
* @param alias Name of common tag
|
|
116
120
|
* @returns {boolean|*} true if given alias is mapped as a singleton', otherwise false
|
|
@@ -30,7 +30,6 @@ export interface INativeMetadataCollector extends IWarningCollector {
|
|
|
30
30
|
* Responsible for triggering async updates
|
|
31
31
|
*/
|
|
32
32
|
export declare class MetadataCollector implements INativeMetadataCollector {
|
|
33
|
-
private opts?;
|
|
34
33
|
readonly format: IFormat;
|
|
35
34
|
readonly native: INativeTags;
|
|
36
35
|
readonly common: ICommonTagsResult;
|
|
@@ -44,7 +43,8 @@ export declare class MetadataCollector implements INativeMetadataCollector {
|
|
|
44
43
|
*/
|
|
45
44
|
private readonly originPriority;
|
|
46
45
|
private tagMapper;
|
|
47
|
-
|
|
46
|
+
private opts?;
|
|
47
|
+
constructor(opts?: IOptions);
|
|
48
48
|
/**
|
|
49
49
|
* @returns {boolean} true if one or more tags have been found
|
|
50
50
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TrackTypeValueToKeyMap } from '../type.js';
|
|
2
2
|
import initDebug from 'debug';
|
|
3
3
|
import { isSingleton, isUnique } from './GenericTagTypes.js';
|
|
4
4
|
import { CombinedTagMapper } from './CombinedTagMapper.js';
|
|
@@ -14,7 +14,6 @@ const TagPriority = ['matroska', 'APEv2', 'vorbis', 'ID3v2.4', 'ID3v2.3', 'ID3v2
|
|
|
14
14
|
*/
|
|
15
15
|
export class MetadataCollector {
|
|
16
16
|
constructor(opts) {
|
|
17
|
-
this.opts = opts;
|
|
18
17
|
this.format = {
|
|
19
18
|
tagTypes: [],
|
|
20
19
|
trackInfo: []
|
|
@@ -37,6 +36,7 @@ export class MetadataCollector {
|
|
|
37
36
|
*/
|
|
38
37
|
this.originPriority = {};
|
|
39
38
|
this.tagMapper = new CombinedTagMapper();
|
|
39
|
+
this.opts = opts;
|
|
40
40
|
let priority = 1;
|
|
41
41
|
for (const tagType of TagPriority) {
|
|
42
42
|
this.originPriority[tagType] = priority++;
|
|
@@ -51,7 +51,7 @@ export class MetadataCollector {
|
|
|
51
51
|
return Object.keys(this.native).length > 0;
|
|
52
52
|
}
|
|
53
53
|
addStreamInfo(streamInfo) {
|
|
54
|
-
debug(`streamInfo: type=${streamInfo.type ?
|
|
54
|
+
debug(`streamInfo: type=${streamInfo.type ? TrackTypeValueToKeyMap[streamInfo.type] : '?'}, codec=${streamInfo.codecName}`);
|
|
55
55
|
this.format.trackInfo.push(streamInfo);
|
|
56
56
|
}
|
|
57
57
|
setFormat(key, value) {
|
package/lib/core.d.ts
CHANGED
|
@@ -57,3 +57,8 @@ export declare function ratingToStars(rating: number | undefined): number;
|
|
|
57
57
|
*/
|
|
58
58
|
export declare function selectCover(pictures?: IPicture[]): IPicture | null;
|
|
59
59
|
export declare function scanAppendingHeaders(tokenizer: IRandomAccessTokenizer, options?: IPrivateOptions): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Implementation only available when loaded as Node.js
|
|
62
|
+
* This method will throw an Error, always.
|
|
63
|
+
*/
|
|
64
|
+
export declare function parseFile(filePath: string, options?: IOptions): Promise<IAudioMetadata>;
|
package/lib/core.js
CHANGED
|
@@ -103,4 +103,11 @@ export async function scanAppendingHeaders(tokenizer, options = {}) {
|
|
|
103
103
|
}
|
|
104
104
|
options.apeHeader = await APEv2Parser.findApeFooterOffset(tokenizer, apeOffset);
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Implementation only available when loaded as Node.js
|
|
108
|
+
* This method will throw an Error, always.
|
|
109
|
+
*/
|
|
110
|
+
export async function parseFile(filePath, options = {}) {
|
|
111
|
+
throw new Error('To load Web API File objects use parseBlob instead. For loading files, you need to import with the "node" condition is set.');
|
|
112
|
+
}
|
|
106
113
|
//# sourceMappingURL=core.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const dsdiffParserLoader = {
|
|
2
2
|
parserType: 'dsdiff',
|
|
3
3
|
extensions: ['.dff'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./DsdiffParser.js')).DsdiffParser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=DsdiffLoader.js.map
|
package/lib/dsf/DsfChunk.d.ts
CHANGED
|
@@ -34,15 +34,16 @@ export interface IDsdChunk {
|
|
|
34
34
|
* Common chunk DSD header: the 'chunk name (Four-CC)' & chunk size
|
|
35
35
|
*/
|
|
36
36
|
export declare const DsdChunk: IGetToken<IDsdChunk>;
|
|
37
|
-
export declare
|
|
38
|
-
mono
|
|
39
|
-
stereo
|
|
40
|
-
channels
|
|
41
|
-
quad
|
|
42
|
-
'4 channels'
|
|
43
|
-
'5 channels'
|
|
44
|
-
'5.1 channels'
|
|
45
|
-
}
|
|
37
|
+
export declare const ChannelType: {
|
|
38
|
+
mono: number;
|
|
39
|
+
stereo: number;
|
|
40
|
+
channels: number;
|
|
41
|
+
quad: number;
|
|
42
|
+
'4 channels': number;
|
|
43
|
+
'5 channels': number;
|
|
44
|
+
'5.1 channels': number;
|
|
45
|
+
};
|
|
46
|
+
export type ChannelType = typeof ChannelType[keyof typeof ChannelType];
|
|
46
47
|
/**
|
|
47
48
|
* Interface to format chunk payload chunk
|
|
48
49
|
*/
|
package/lib/dsf/DsfChunk.js
CHANGED
|
@@ -21,16 +21,15 @@ export const DsdChunk = {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
})(ChannelType || (ChannelType = {}));
|
|
24
|
+
export const ChannelType = {
|
|
25
|
+
mono: 1,
|
|
26
|
+
stereo: 2,
|
|
27
|
+
channels: 3,
|
|
28
|
+
quad: 4,
|
|
29
|
+
'4 channels': 5,
|
|
30
|
+
'5 channels': 6,
|
|
31
|
+
'5.1 channels': 7
|
|
32
|
+
};
|
|
34
33
|
/**
|
|
35
34
|
* Common chunk DSD header: the 'chunk name (Four-CC)' & chunk size
|
|
36
35
|
*/
|
package/lib/dsf/DsfLoader.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const dsfParserLoader = {
|
|
2
2
|
parserType: 'dsf',
|
|
3
3
|
extensions: ['.dsf'],
|
|
4
|
-
async load(
|
|
5
|
-
return
|
|
4
|
+
async load() {
|
|
5
|
+
return (await import('./DsfParser.js')).DsfParser;
|
|
6
6
|
}
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=DsfLoader.js.map
|
|
@@ -21,13 +21,14 @@ export interface ILinkedElementType extends IElementType {
|
|
|
21
21
|
[id: number]: ILinkedElementType;
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
export declare
|
|
25
|
-
ReadNext
|
|
26
|
-
IgnoreElement
|
|
27
|
-
SkipSiblings
|
|
28
|
-
TerminateParsing
|
|
29
|
-
SkipElement
|
|
30
|
-
}
|
|
24
|
+
export declare const ParseAction: {
|
|
25
|
+
readonly ReadNext: 0;
|
|
26
|
+
readonly IgnoreElement: 2;
|
|
27
|
+
readonly SkipSiblings: 3;
|
|
28
|
+
readonly TerminateParsing: 4;
|
|
29
|
+
readonly SkipElement: 5;
|
|
30
|
+
};
|
|
31
|
+
export type ParseAction = typeof ParseAction[keyof typeof ParseAction];
|
|
31
32
|
/**
|
|
32
33
|
* @return true, to quit the parser
|
|
33
34
|
*/
|
|
@@ -43,11 +44,11 @@ export type IElementListener = {
|
|
|
43
44
|
* WEBM VP8 AUDIO FILE
|
|
44
45
|
*/
|
|
45
46
|
export declare class EbmlIterator {
|
|
46
|
-
private tokenizer;
|
|
47
47
|
private padding;
|
|
48
48
|
private parserMap;
|
|
49
49
|
private ebmlMaxIDLength;
|
|
50
50
|
private ebmlMaxSizeLength;
|
|
51
|
+
private tokenizer;
|
|
51
52
|
/**
|
|
52
53
|
* @param {ITokenizer} tokenizer Input
|
|
53
54
|
* @param tokenizer
|