music-metadata 11.12.1 → 11.12.2
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/asf/AsfLoader.js +1 -1
- package/lib/asf/AsfParser.js +4 -6
- package/package.json +13 -9
- package/lib/ParseError.d.ts +0 -87
- package/lib/ParserFactory.d.ts +0 -44
- package/lib/aiff/AiffLoader.d.ts +0 -2
- package/lib/aiff/AiffParser.d.ts +0 -15
- package/lib/aiff/AiffTagMap.d.ts +0 -4
- package/lib/aiff/AiffToken.d.ts +0 -48
- package/lib/apev2/APEv2Parser.d.ts +0 -46
- package/lib/apev2/APEv2TagMapper.d.ts +0 -4
- package/lib/apev2/APEv2Token.d.ts +0 -99
- package/lib/apev2/Apev2Loader.d.ts +0 -2
- package/lib/asf/AsfGuid.d.ts +0 -83
- package/lib/asf/AsfLoader.d.ts +0 -2
- package/lib/asf/AsfObject.d.ts +0 -325
- package/lib/asf/AsfParser.d.ts +0 -17
- package/lib/asf/AsfTagMapper.d.ts +0 -7
- package/lib/asf/AsfUtil.d.ts +0 -4
- package/lib/common/BasicParser.d.ts +0 -17
- package/lib/common/CaseInsensitiveTagMap.d.ts +0 -10
- package/lib/common/CombinedTagMapper.d.ts +0 -19
- package/lib/common/FourCC.d.ts +0 -6
- package/lib/common/GenericTagMapper.d.ts +0 -51
- package/lib/common/GenericTagTypes.d.ts +0 -34
- package/lib/common/MetadataCollector.d.ts +0 -86
- package/lib/common/Util.d.ts +0 -56
- package/lib/core.d.ts +0 -75
- package/lib/dsdiff/DsdiffLoader.d.ts +0 -2
- package/lib/dsdiff/DsdiffParser.d.ts +0 -29
- package/lib/dsdiff/DsdiffToken.d.ts +0 -9
- package/lib/dsf/DsfChunk.d.ts +0 -87
- package/lib/dsf/DsfLoader.d.ts +0 -2
- package/lib/dsf/DsfParser.d.ts +0 -24
- package/lib/ebml/EbmlIterator.d.ts +0 -67
- package/lib/ebml/types.d.ts +0 -37
- package/lib/flac/FlacLoader.d.ts +0 -2
- package/lib/flac/FlacParser.d.ts +0 -29
- package/lib/flac/FlacToken.d.ts +0 -45
- package/lib/id3v1/ID3v1Parser.d.ts +0 -17
- package/lib/id3v1/ID3v1TagMap.d.ts +0 -4
- package/lib/id3v2/AbstractID3Parser.d.ts +0 -17
- package/lib/id3v2/FrameHeader.d.ts +0 -31
- package/lib/id3v2/FrameParser.d.ts +0 -92
- package/lib/id3v2/ID3v22TagMapper.d.ts +0 -9
- package/lib/id3v2/ID3v24TagMapper.d.ts +0 -14
- package/lib/id3v2/ID3v2ChapterToken.d.ts +0 -11
- package/lib/id3v2/ID3v2Parser.d.ts +0 -33
- package/lib/id3v2/ID3v2Token.d.ts +0 -111
- package/lib/iff/index.d.ts +0 -33
- package/lib/index.d.ts +0 -22
- package/lib/lrc/LyricsParser.d.ts +0 -9
- package/lib/lyrics3/Lyrics3.d.ts +0 -3
- package/lib/matroska/MatroskaDtd.d.ts +0 -8
- package/lib/matroska/MatroskaLoader.d.ts +0 -2
- package/lib/matroska/MatroskaParser.d.ts +0 -19
- package/lib/matroska/MatroskaTagMapper.d.ts +0 -4
- package/lib/matroska/types.d.ts +0 -142
- package/lib/mp4/Atom.d.ts +0 -16
- package/lib/mp4/AtomToken.d.ts +0 -487
- package/lib/mp4/MP4Parser.d.ts +0 -32
- package/lib/mp4/MP4TagMapper.d.ts +0 -8
- package/lib/mp4/Mp4Loader.d.ts +0 -2
- package/lib/mpeg/ExtendedLameHeader.d.ts +0 -27
- package/lib/mpeg/MpegLoader.d.ts +0 -2
- package/lib/mpeg/MpegParser.d.ts +0 -62
- package/lib/mpeg/ReplayGainDataFormat.d.ts +0 -57
- package/lib/mpeg/XingTag.d.ts +0 -44
- package/lib/musepack/MusepackConentError.d.ts +0 -15
- package/lib/musepack/MusepackLoader.d.ts +0 -2
- package/lib/musepack/MusepackParser.d.ts +0 -4
- package/lib/musepack/sv7/BitReader.d.ts +0 -13
- package/lib/musepack/sv7/MpcSv7Parser.d.ts +0 -8
- package/lib/musepack/sv7/StreamVersion7.d.ts +0 -28
- package/lib/musepack/sv8/MpcSv8Parser.d.ts +0 -6
- package/lib/musepack/sv8/StreamVersion8.d.ts +0 -42
- package/lib/ogg/OggLoader.d.ts +0 -2
- package/lib/ogg/OggParser.d.ts +0 -27
- package/lib/ogg/OggToken.d.ts +0 -83
- package/lib/ogg/flac/FlacStream.d.ts +0 -29
- package/lib/ogg/opus/Opus.d.ts +0 -63
- package/lib/ogg/opus/OpusStream.d.ts +0 -24
- package/lib/ogg/speex/Speex.d.ts +0 -36
- package/lib/ogg/speex/SpeexStream.d.ts +0 -20
- package/lib/ogg/theora/Theora.d.ts +0 -20
- package/lib/ogg/theora/TheoraStream.d.ts +0 -25
- package/lib/ogg/vorbis/Vorbis.d.ts +0 -68
- package/lib/ogg/vorbis/VorbisDecoder.d.ts +0 -12
- package/lib/ogg/vorbis/VorbisStream.d.ts +0 -53
- package/lib/ogg/vorbis/VorbisTagMapper.d.ts +0 -7
- package/lib/riff/RiffChunk.d.ts +0 -16
- package/lib/riff/RiffInfoTagMap.d.ts +0 -10
- package/lib/type.d.ts +0 -661
- package/lib/wav/BwfChunk.d.ts +0 -17
- package/lib/wav/WaveChunk.d.ts +0 -94
- package/lib/wav/WaveLoader.d.ts +0 -2
- package/lib/wav/WaveParser.d.ts +0 -24
- package/lib/wavpack/WavPackLoader.d.ts +0 -2
- package/lib/wavpack/WavPackParser.d.ts +0 -30
- package/lib/wavpack/WavPackToken.d.ts +0 -60
package/lib/asf/AsfLoader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export const asfParserLoader = {
|
|
2
2
|
parserType: 'asf',
|
|
3
|
-
extensions: ['.asf'],
|
|
3
|
+
extensions: ['.asf', '.wma', '.wmv'],
|
|
4
4
|
mimeTypes: ['audio/ms-wma', 'video/ms-wmv', 'audio/ms-asf', 'video/ms-asf', 'application/vnd.ms-asf'],
|
|
5
5
|
async load() {
|
|
6
6
|
return (await import('./AsfParser.js')).AsfParser;
|
package/lib/asf/AsfParser.js
CHANGED
|
@@ -22,12 +22,7 @@ export class AsfParser extends BasicParser {
|
|
|
22
22
|
if (!header.objectId.equals(AsfGuid.HeaderObject)) {
|
|
23
23
|
throw new AsfContentParseError(`expected asf header; but was not found; got: ${header.objectId.str}`);
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
await this.parseObjectHeader(header.numberOfHeaderObjects);
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
debug('Error while parsing ASF: %s', err);
|
|
30
|
-
}
|
|
25
|
+
await this.parseObjectHeader(header.numberOfHeaderObjects);
|
|
31
26
|
}
|
|
32
27
|
async parseObjectHeader(numberOfObjectHeaders) {
|
|
33
28
|
let tags;
|
|
@@ -98,6 +93,9 @@ export class AsfParser extends BasicParser {
|
|
|
98
93
|
// Parse common header of the ASF Object (3.1)
|
|
99
94
|
const header = await this.tokenizer.readToken(AsfObject.HeaderObjectToken);
|
|
100
95
|
const remaining = header.objectSize - AsfObject.HeaderObjectToken.len;
|
|
96
|
+
if (remaining < 0) {
|
|
97
|
+
throw new AsfContentParseError(`Invalid ASF header object size: ${header.objectSize}`);
|
|
98
|
+
}
|
|
101
99
|
// Parse data part of the ASF Object
|
|
102
100
|
switch (header.objectId.str) {
|
|
103
101
|
case AsfObject.ExtendedStreamPropertiesObjectState.guid.str: // 4.1
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "music-metadata",
|
|
3
3
|
"description": "Music metadata parser for Node.js, supporting virtual any audio and tag format.",
|
|
4
|
-
"version": "11.12.
|
|
4
|
+
"version": "11.12.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Borewit",
|
|
7
7
|
"url": "https://github.com/Borewit"
|
|
@@ -91,16 +91,20 @@
|
|
|
91
91
|
],
|
|
92
92
|
"scripts": {
|
|
93
93
|
"clean": "del-cli 'lib/**/*.js' 'lib/**/*.js.map' 'lib/**/*.d.ts' 'test/**/*.js' 'test/**/*.js.map' 'test/**/*.js' 'test/**/*.js.map' 'doc-gen/**/*.js' 'doc-gen/**/*.js.map'",
|
|
94
|
-
"compile-src": "tsc -p lib
|
|
94
|
+
"compile-src:dev": "tsc -p lib/tsconfig.json",
|
|
95
|
+
"compile-src:prod": "tsc -p lib/tsconfig.prod.json",
|
|
95
96
|
"compile-test": "tsc -p test",
|
|
96
97
|
"compile-doc": "tsc -p doc-gen",
|
|
97
|
-
"compile": "yarn run compile-src && yarn compile-test && yarn compile-doc",
|
|
98
|
+
"compile:dev": "yarn run compile-src:dev && yarn compile-test && yarn compile-doc",
|
|
99
|
+
"compile:prod": "yarn run compile-src:prod && yarn compile-test && yarn compile-doc",
|
|
98
100
|
"lint:ts": "biome check",
|
|
99
101
|
"lint:md": "yarn run remark -u remark-preset-lint-consistent .",
|
|
100
102
|
"lint": "yarn run lint:ts && yarn run lint:md",
|
|
101
103
|
"test": "mocha",
|
|
102
|
-
"build": "yarn run clean && yarn compile && yarn run doc-gen",
|
|
103
|
-
"
|
|
104
|
+
"build:dev": "yarn run clean && yarn compile:dev && yarn run doc-gen",
|
|
105
|
+
"build:prod": "yarn run clean && yarn compile:prod && yarn run doc-gen",
|
|
106
|
+
"build": "yarn run build:prod",
|
|
107
|
+
"prepublishOnly": "yarn run build:prod",
|
|
104
108
|
"test-coverage": "c8 yarn run test",
|
|
105
109
|
"send-codacy": "c8 report --reporter=text-lcov | codacy-coverage",
|
|
106
110
|
"doc-gen": "yarn node doc-gen/gen.js",
|
|
@@ -108,11 +112,11 @@
|
|
|
108
112
|
"update-biome": "yarn add -D --exact @biomejs/biome && npx @biomejs/biome migrate --write"
|
|
109
113
|
},
|
|
110
114
|
"dependencies": {
|
|
111
|
-
"@borewit/text-codec": "^0.2.
|
|
115
|
+
"@borewit/text-codec": "^0.2.2",
|
|
112
116
|
"@tokenizer/token": "^0.3.0",
|
|
113
117
|
"content-type": "^1.0.5",
|
|
114
118
|
"debug": "^4.4.3",
|
|
115
|
-
"file-type": "^21.3.
|
|
119
|
+
"file-type": "^21.3.1",
|
|
116
120
|
"media-typer": "^1.1.0",
|
|
117
121
|
"strtok3": "^10.3.4",
|
|
118
122
|
"token-types": "^6.1.2",
|
|
@@ -120,7 +124,7 @@
|
|
|
120
124
|
"win-guid": "^0.2.1"
|
|
121
125
|
},
|
|
122
126
|
"devDependencies": {
|
|
123
|
-
"@biomejs/biome": "2.4.
|
|
127
|
+
"@biomejs/biome": "2.4.6",
|
|
124
128
|
"@types/chai": "^5.2.3",
|
|
125
129
|
"@types/chai-as-promised": "^8.0.2",
|
|
126
130
|
"@types/content-type": "^1.1.9",
|
|
@@ -128,7 +132,7 @@
|
|
|
128
132
|
"@types/media-typer": "^1.1.3",
|
|
129
133
|
"@types/mocha": "^10.0.10",
|
|
130
134
|
"@types/node": "^25.2.0",
|
|
131
|
-
"c8": "^
|
|
135
|
+
"c8": "^11.0.0",
|
|
132
136
|
"chai": "^6.2.2",
|
|
133
137
|
"chai-as-promised": "^8.0.2",
|
|
134
138
|
"del-cli": "^7.0.0",
|
package/lib/ParseError.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
export type UnionOfParseErrors = CouldNotDetermineFileTypeError | UnsupportedFileTypeError | UnexpectedFileContentError | FieldDecodingError | InternalParserError;
|
|
2
|
-
export declare const makeParseError: <Name extends string>(name: Name) => {
|
|
3
|
-
new (message: string): {
|
|
4
|
-
name: Name;
|
|
5
|
-
message: string;
|
|
6
|
-
stack?: string;
|
|
7
|
-
};
|
|
8
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
9
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
10
|
-
stackTraceLimit: number;
|
|
11
|
-
};
|
|
12
|
-
declare const CouldNotDetermineFileTypeError_base: {
|
|
13
|
-
new (message: string): {
|
|
14
|
-
name: "CouldNotDetermineFileTypeError";
|
|
15
|
-
message: string;
|
|
16
|
-
stack?: string;
|
|
17
|
-
};
|
|
18
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
19
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
20
|
-
stackTraceLimit: number;
|
|
21
|
-
};
|
|
22
|
-
export declare class CouldNotDetermineFileTypeError extends CouldNotDetermineFileTypeError_base {
|
|
23
|
-
}
|
|
24
|
-
declare const UnsupportedFileTypeError_base: {
|
|
25
|
-
new (message: string): {
|
|
26
|
-
name: "UnsupportedFileTypeError";
|
|
27
|
-
message: string;
|
|
28
|
-
stack?: string;
|
|
29
|
-
};
|
|
30
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
31
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
32
|
-
stackTraceLimit: number;
|
|
33
|
-
};
|
|
34
|
-
export declare class UnsupportedFileTypeError extends UnsupportedFileTypeError_base {
|
|
35
|
-
}
|
|
36
|
-
declare const UnexpectedFileContentError_base: {
|
|
37
|
-
new (message: string): {
|
|
38
|
-
name: "UnexpectedFileContentError";
|
|
39
|
-
message: string;
|
|
40
|
-
stack?: string;
|
|
41
|
-
};
|
|
42
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
43
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
44
|
-
stackTraceLimit: number;
|
|
45
|
-
};
|
|
46
|
-
declare class UnexpectedFileContentError extends UnexpectedFileContentError_base {
|
|
47
|
-
readonly fileType: string;
|
|
48
|
-
constructor(fileType: string, message: string);
|
|
49
|
-
toString(): string;
|
|
50
|
-
}
|
|
51
|
-
declare const FieldDecodingError_base: {
|
|
52
|
-
new (message: string): {
|
|
53
|
-
name: "FieldDecodingError";
|
|
54
|
-
message: string;
|
|
55
|
-
stack?: string;
|
|
56
|
-
};
|
|
57
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
58
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
59
|
-
stackTraceLimit: number;
|
|
60
|
-
};
|
|
61
|
-
export declare class FieldDecodingError extends FieldDecodingError_base {
|
|
62
|
-
}
|
|
63
|
-
declare const InternalParserError_base: {
|
|
64
|
-
new (message: string): {
|
|
65
|
-
name: "InternalParserError";
|
|
66
|
-
message: string;
|
|
67
|
-
stack?: string;
|
|
68
|
-
};
|
|
69
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
70
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
71
|
-
stackTraceLimit: number;
|
|
72
|
-
};
|
|
73
|
-
export declare class InternalParserError extends InternalParserError_base {
|
|
74
|
-
}
|
|
75
|
-
export declare const makeUnexpectedFileContentError: <FileType extends string>(fileType: FileType) => {
|
|
76
|
-
new (message: string): {
|
|
77
|
-
readonly fileType: string;
|
|
78
|
-
toString(): string;
|
|
79
|
-
name: "UnexpectedFileContentError";
|
|
80
|
-
message: string;
|
|
81
|
-
stack?: string;
|
|
82
|
-
};
|
|
83
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
84
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
85
|
-
stackTraceLimit: number;
|
|
86
|
-
};
|
|
87
|
-
export {};
|
package/lib/ParserFactory.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { type MediaType } from 'media-typer';
|
|
2
|
-
import { type INativeMetadataCollector } from './common/MetadataCollector.js';
|
|
3
|
-
import { type IAudioMetadata, type IOptions, type ParserType } from './type.js';
|
|
4
|
-
import type { ITokenizer } from 'strtok3';
|
|
5
|
-
export interface IParserLoader {
|
|
6
|
-
/**
|
|
7
|
-
* Returns a list of supported file extensions
|
|
8
|
-
*/
|
|
9
|
-
extensions: string[];
|
|
10
|
-
mimeTypes: string[];
|
|
11
|
-
parserType: ParserType;
|
|
12
|
-
/**
|
|
13
|
-
* Lazy load the parser implementation class.
|
|
14
|
-
*/
|
|
15
|
-
load(): Promise<new (metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions) => ITokenParser>;
|
|
16
|
-
}
|
|
17
|
-
export interface ITokenParser {
|
|
18
|
-
/**
|
|
19
|
-
* Parse audio track.
|
|
20
|
-
* Called after init(...).
|
|
21
|
-
* @returns Promise
|
|
22
|
-
*/
|
|
23
|
-
parse(): Promise<void>;
|
|
24
|
-
}
|
|
25
|
-
interface IContentType extends MediaType {
|
|
26
|
-
parameters: {
|
|
27
|
-
[id: string]: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export declare function parseHttpContentType(contentType: string): IContentType;
|
|
31
|
-
export declare class ParserFactory {
|
|
32
|
-
parsers: IParserLoader[];
|
|
33
|
-
constructor();
|
|
34
|
-
registerParser(parser: IParserLoader): void;
|
|
35
|
-
parse(tokenizer: ITokenizer, parserLoader: IParserLoader | undefined, opts?: IOptions): Promise<IAudioMetadata>;
|
|
36
|
-
/**
|
|
37
|
-
* @param filePath - Path, filename or extension to audio file
|
|
38
|
-
* @return Parser submodule name
|
|
39
|
-
*/
|
|
40
|
-
findLoaderForExtension(filePath: string | undefined): IParserLoader | undefined;
|
|
41
|
-
findLoaderForContentType(httpContentType: string): IParserLoader | undefined;
|
|
42
|
-
getSupportedMimeTypes(): string[];
|
|
43
|
-
}
|
|
44
|
-
export {};
|
package/lib/aiff/AiffLoader.d.ts
DELETED
package/lib/aiff/AiffParser.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BasicParser } from '../common/BasicParser.js';
|
|
2
|
-
import * as iff from '../iff/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* AIFF - Audio Interchange File Format
|
|
5
|
-
*
|
|
6
|
-
* Ref:
|
|
7
|
-
* - http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/AIFF.html
|
|
8
|
-
* - http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/AIFF/Docs/AIFF-1.3.pdf
|
|
9
|
-
*/
|
|
10
|
-
export declare class AIFFParser extends BasicParser {
|
|
11
|
-
private isCompressed;
|
|
12
|
-
parse(): Promise<void>;
|
|
13
|
-
readData(header: iff.IChunkHeader): Promise<number>;
|
|
14
|
-
readTextChunk(header: iff.IChunkHeader): Promise<number>;
|
|
15
|
-
}
|
package/lib/aiff/AiffTagMap.d.ts
DELETED
package/lib/aiff/AiffToken.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type * as iff from '../iff/index.js';
|
|
2
|
-
import type { IGetToken } from 'strtok3';
|
|
3
|
-
export declare const compressionTypes: {
|
|
4
|
-
NONE: string;
|
|
5
|
-
sowt: string;
|
|
6
|
-
fl32: string;
|
|
7
|
-
fl64: string;
|
|
8
|
-
alaw: string;
|
|
9
|
-
ulaw: string;
|
|
10
|
-
ULAW: string;
|
|
11
|
-
ALAW: string;
|
|
12
|
-
FL32: string;
|
|
13
|
-
};
|
|
14
|
-
export type CompressionTypeCode = keyof typeof compressionTypes;
|
|
15
|
-
declare const AiffContentError_base: {
|
|
16
|
-
new (message: string): {
|
|
17
|
-
readonly fileType: string;
|
|
18
|
-
toString(): string;
|
|
19
|
-
name: "UnexpectedFileContentError";
|
|
20
|
-
message: string;
|
|
21
|
-
stack?: string;
|
|
22
|
-
};
|
|
23
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
24
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
25
|
-
stackTraceLimit: number;
|
|
26
|
-
};
|
|
27
|
-
export declare class AiffContentError extends AiffContentError_base {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The Common Chunk.
|
|
31
|
-
* Describes fundamental parameters of the waveform data such as sample rate, bit resolution, and how many channels of
|
|
32
|
-
* digital audio are stored in the FORM AIFF.
|
|
33
|
-
*/
|
|
34
|
-
export interface ICommon {
|
|
35
|
-
numChannels: number;
|
|
36
|
-
numSampleFrames: number;
|
|
37
|
-
sampleSize: number;
|
|
38
|
-
sampleRate: number;
|
|
39
|
-
compressionType?: CompressionTypeCode;
|
|
40
|
-
compressionName?: string;
|
|
41
|
-
}
|
|
42
|
-
export declare class Common implements IGetToken<ICommon> {
|
|
43
|
-
len: number;
|
|
44
|
-
private isAifc;
|
|
45
|
-
constructor(header: iff.IChunkHeader, isAifc: boolean);
|
|
46
|
-
get(buf: Uint8Array, off: number): ICommon;
|
|
47
|
-
}
|
|
48
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import * as strtok3 from 'strtok3';
|
|
2
|
-
import type { IOptions, IApeHeader } from '../type.js';
|
|
3
|
-
import type { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
4
|
-
import { BasicParser } from '../common/BasicParser.js';
|
|
5
|
-
import { type IFooter, type IHeader } from './APEv2Token.js';
|
|
6
|
-
import type { IRandomAccessTokenizer } from 'strtok3';
|
|
7
|
-
declare const ApeContentError_base: {
|
|
8
|
-
new (message: string): {
|
|
9
|
-
readonly fileType: string;
|
|
10
|
-
toString(): string;
|
|
11
|
-
name: "UnexpectedFileContentError";
|
|
12
|
-
message: string;
|
|
13
|
-
stack?: string;
|
|
14
|
-
};
|
|
15
|
-
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
16
|
-
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
17
|
-
stackTraceLimit: number;
|
|
18
|
-
};
|
|
19
|
-
export declare class ApeContentError extends ApeContentError_base {
|
|
20
|
-
}
|
|
21
|
-
export declare function tryParseApeHeader(metadata: INativeMetadataCollector, tokenizer: strtok3.ITokenizer, options: IOptions): Promise<void>;
|
|
22
|
-
export declare class APEv2Parser extends BasicParser {
|
|
23
|
-
/**
|
|
24
|
-
* Calculate the media file duration
|
|
25
|
-
* @param ah ApeHeader
|
|
26
|
-
* @return {number} duration in seconds
|
|
27
|
-
*/
|
|
28
|
-
static calculateDuration(ah: IHeader): number;
|
|
29
|
-
/**
|
|
30
|
-
* Calculates the APEv1 / APEv2 first field offset
|
|
31
|
-
* @param tokenizer
|
|
32
|
-
* @param offset
|
|
33
|
-
*/
|
|
34
|
-
static findApeFooterOffset(tokenizer: IRandomAccessTokenizer, offset: number): Promise<IApeHeader | undefined>;
|
|
35
|
-
private static parseTagFooter;
|
|
36
|
-
private ape;
|
|
37
|
-
/**
|
|
38
|
-
* Parse APEv1 / APEv2 header if header signature found
|
|
39
|
-
*/
|
|
40
|
-
tryParseApeHeader(): Promise<void>;
|
|
41
|
-
parse(): Promise<void>;
|
|
42
|
-
parseTags(footer: IFooter): Promise<void>;
|
|
43
|
-
private parseDescriptorExpansion;
|
|
44
|
-
private parseHeader;
|
|
45
|
-
}
|
|
46
|
-
export {};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import type { IGetToken } from 'strtok3';
|
|
2
|
-
/**
|
|
3
|
-
* APETag versionIndex history / supported formats
|
|
4
|
-
*
|
|
5
|
-
* 1.0 (1000) - Original APE tag spec. Fully supported by this code.
|
|
6
|
-
* 2.0 (2000) - Refined APE tag spec (better streaming support, UTF StringEncoding). Fully supported by this code.
|
|
7
|
-
*
|
|
8
|
-
* Notes:
|
|
9
|
-
* - also supports reading of ID3v1.1 tags
|
|
10
|
-
* - all saving done in the APE Tag format using CURRENT_APE_TAG_VERSION
|
|
11
|
-
*
|
|
12
|
-
* APE File Format Overview: (pieces in order -- only valid for the latest versionIndex APE files)
|
|
13
|
-
*
|
|
14
|
-
* JUNK - any amount of "junk" before the APE_DESCRIPTOR (so people that put ID3v2 tags on the files aren't hosed)
|
|
15
|
-
* APE_DESCRIPTOR - defines the sizes (and offsets) of all the pieces, as well as the MD5 checksum
|
|
16
|
-
* APE_HEADER - describes all of the necessary information about the APE file
|
|
17
|
-
* SEEK TABLE - the table that represents seek offsets [optional]
|
|
18
|
-
* HEADER DATA - the pre-audio data from the original file [optional]
|
|
19
|
-
* APE FRAMES - the actual compressed audio (broken into frames for seekability)
|
|
20
|
-
* TERMINATING DATA - the post-audio data from the original file [optional]
|
|
21
|
-
* TAG - describes all the properties of the file [optional]
|
|
22
|
-
*/
|
|
23
|
-
export interface IDescriptor {
|
|
24
|
-
ID: string;
|
|
25
|
-
version: number;
|
|
26
|
-
descriptorBytes: number;
|
|
27
|
-
headerBytes: number;
|
|
28
|
-
seekTableBytes: number;
|
|
29
|
-
headerDataBytes: number;
|
|
30
|
-
apeFrameDataBytes: number;
|
|
31
|
-
apeFrameDataBytesHigh: number;
|
|
32
|
-
terminatingDataBytes: number;
|
|
33
|
-
fileMD5: Uint8Array;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* APE_HEADER: describes all of the necessary information about the APE file
|
|
37
|
-
*/
|
|
38
|
-
export interface IHeader {
|
|
39
|
-
compressionLevel: number;
|
|
40
|
-
formatFlags: number;
|
|
41
|
-
blocksPerFrame: number;
|
|
42
|
-
finalFrameBlocks: number;
|
|
43
|
-
totalFrames: number;
|
|
44
|
-
bitsPerSample: number;
|
|
45
|
-
channel: number;
|
|
46
|
-
sampleRate: number;
|
|
47
|
-
}
|
|
48
|
-
export interface IFooter {
|
|
49
|
-
ID: string;
|
|
50
|
-
version: number;
|
|
51
|
-
size: number;
|
|
52
|
-
fields: number;
|
|
53
|
-
flags: ITagFlags;
|
|
54
|
-
}
|
|
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];
|
|
62
|
-
/**
|
|
63
|
-
* APE_DESCRIPTOR: defines the sizes (and offsets) of all the pieces, as well as the MD5 checksum
|
|
64
|
-
*/
|
|
65
|
-
export declare const DescriptorParser: IGetToken<IDescriptor>;
|
|
66
|
-
/**
|
|
67
|
-
* APE_HEADER: describes all of the necessary information about the APE file
|
|
68
|
-
*/
|
|
69
|
-
export declare const Header: IGetToken<IHeader>;
|
|
70
|
-
/**
|
|
71
|
-
* APE Tag Header/Footer Version 2.0
|
|
72
|
-
* TAG: describes all the properties of the file [optional]
|
|
73
|
-
*/
|
|
74
|
-
export declare const TagFooter: IGetToken<IFooter>;
|
|
75
|
-
/**
|
|
76
|
-
* APE Tag v2.0 Item Header
|
|
77
|
-
*/
|
|
78
|
-
export interface ITagItemHeader {
|
|
79
|
-
size: number;
|
|
80
|
-
flags: ITagFlags;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* APE Tag v2.0 Item Header
|
|
84
|
-
*/
|
|
85
|
-
export declare const TagItemHeader: IGetToken<ITagItemHeader>;
|
|
86
|
-
export interface ITagFlags {
|
|
87
|
-
containsHeader: boolean;
|
|
88
|
-
containsFooter: boolean;
|
|
89
|
-
isHeader: boolean;
|
|
90
|
-
readOnly: boolean;
|
|
91
|
-
dataType: DataType;
|
|
92
|
-
}
|
|
93
|
-
export declare function parseTagFlags(flags: number): ITagFlags;
|
|
94
|
-
/**
|
|
95
|
-
* @param num {number}
|
|
96
|
-
* @param bit 0 is least significant bit (LSB)
|
|
97
|
-
* @return {boolean} true if bit is 1; otherwise false
|
|
98
|
-
*/
|
|
99
|
-
export declare function isBitSet(num: number, bit: number): boolean;
|
package/lib/asf/AsfGuid.d.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ref:
|
|
3
|
-
* - https://tools.ietf.org/html/draft-fleischman-asf-01, Appendix A: ASF GUIDs
|
|
4
|
-
* - http://drang.s4.xrea.com/program/tips/id3tag/wmp/10_asf_guids.html
|
|
5
|
-
* - http://drang.s4.xrea.com/program/tips/id3tag/wmp/index.html
|
|
6
|
-
* - http://drang.s4.xrea.com/program/tips/id3tag/wmp/10_asf_guids.html
|
|
7
|
-
*
|
|
8
|
-
* ASF File Structure:
|
|
9
|
-
* - https://msdn.microsoft.com/en-us/library/windows/desktop/ee663575(v=vs.85).aspx
|
|
10
|
-
*
|
|
11
|
-
* ASF GUIDs:
|
|
12
|
-
* - http://drang.s4.xrea.com/program/tips/id3tag/wmp/10_asf_guids.html
|
|
13
|
-
* - https://github.com/dji-sdk/FFmpeg/blob/master/libavformat/asf.c
|
|
14
|
-
*/
|
|
15
|
-
export default class AsfGuid {
|
|
16
|
-
static HeaderObject: AsfGuid;
|
|
17
|
-
static DataObject: AsfGuid;
|
|
18
|
-
static SimpleIndexObject: AsfGuid;
|
|
19
|
-
static IndexObject: AsfGuid;
|
|
20
|
-
static MediaObjectIndexObject: AsfGuid;
|
|
21
|
-
static TimecodeIndexObject: AsfGuid;
|
|
22
|
-
static FilePropertiesObject: AsfGuid;
|
|
23
|
-
static StreamPropertiesObject: AsfGuid;
|
|
24
|
-
static HeaderExtensionObject: AsfGuid;
|
|
25
|
-
static CodecListObject: AsfGuid;
|
|
26
|
-
static ScriptCommandObject: AsfGuid;
|
|
27
|
-
static MarkerObject: AsfGuid;
|
|
28
|
-
static BitrateMutualExclusionObject: AsfGuid;
|
|
29
|
-
static ErrorCorrectionObject: AsfGuid;
|
|
30
|
-
static ContentDescriptionObject: AsfGuid;
|
|
31
|
-
static ExtendedContentDescriptionObject: AsfGuid;
|
|
32
|
-
static ContentBrandingObject: AsfGuid;
|
|
33
|
-
static StreamBitratePropertiesObject: AsfGuid;
|
|
34
|
-
static ContentEncryptionObject: AsfGuid;
|
|
35
|
-
static ExtendedContentEncryptionObject: AsfGuid;
|
|
36
|
-
static DigitalSignatureObject: AsfGuid;
|
|
37
|
-
static PaddingObject: AsfGuid;
|
|
38
|
-
static ExtendedStreamPropertiesObject: AsfGuid;
|
|
39
|
-
static AdvancedMutualExclusionObject: AsfGuid;
|
|
40
|
-
static GroupMutualExclusionObject: AsfGuid;
|
|
41
|
-
static StreamPrioritizationObject: AsfGuid;
|
|
42
|
-
static BandwidthSharingObject: AsfGuid;
|
|
43
|
-
static LanguageListObject: AsfGuid;
|
|
44
|
-
static MetadataObject: AsfGuid;
|
|
45
|
-
static MetadataLibraryObject: AsfGuid;
|
|
46
|
-
static IndexParametersObject: AsfGuid;
|
|
47
|
-
static MediaObjectIndexParametersObject: AsfGuid;
|
|
48
|
-
static TimecodeIndexParametersObject: AsfGuid;
|
|
49
|
-
static CompatibilityObject: AsfGuid;
|
|
50
|
-
static AdvancedContentEncryptionObject: AsfGuid;
|
|
51
|
-
static AudioMedia: AsfGuid;
|
|
52
|
-
static VideoMedia: AsfGuid;
|
|
53
|
-
static CommandMedia: AsfGuid;
|
|
54
|
-
static JFIF_Media: AsfGuid;
|
|
55
|
-
static Degradable_JPEG_Media: AsfGuid;
|
|
56
|
-
static FileTransferMedia: AsfGuid;
|
|
57
|
-
static BinaryMedia: AsfGuid;
|
|
58
|
-
static ASF_Index_Placeholder_Object: AsfGuid;
|
|
59
|
-
static fromBin(bin: Uint8Array, offset?: number): AsfGuid;
|
|
60
|
-
/**
|
|
61
|
-
* Decode GUID in format like "B503BF5F-2EA9-CF11-8EE3-00C00C205365"
|
|
62
|
-
* @param objectId Binary GUID
|
|
63
|
-
* @param offset Read offset in bytes, default 0
|
|
64
|
-
* @returns GUID as dashed hexadecimal representation
|
|
65
|
-
*/
|
|
66
|
-
static decode(objectId: Uint8Array, offset?: number): string;
|
|
67
|
-
/**
|
|
68
|
-
* Decode stream type
|
|
69
|
-
* @param mediaType Media type GUID
|
|
70
|
-
* @returns Media type
|
|
71
|
-
*/
|
|
72
|
-
static decodeMediaType(mediaType: AsfGuid): 'audio' | 'video' | 'command' | 'degradable-jpeg' | 'file-transfer' | 'binary' | undefined;
|
|
73
|
-
/**
|
|
74
|
-
* Encode GUID
|
|
75
|
-
* @param guid GUID like: "B503BF5F-2EA9-CF11-8EE3-00C00C205365"
|
|
76
|
-
* @returns Encoded Binary GUID
|
|
77
|
-
*/
|
|
78
|
-
static encode(guid: string): Uint8Array;
|
|
79
|
-
str: string;
|
|
80
|
-
constructor(str: string);
|
|
81
|
-
equals(guid: AsfGuid): boolean;
|
|
82
|
-
toBin(): Uint8Array;
|
|
83
|
-
}
|
package/lib/asf/AsfLoader.d.ts
DELETED