music-metadata 11.12.2 → 11.12.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/ParseError.d.ts +87 -0
- package/lib/ParserFactory.d.ts +44 -0
- package/lib/aiff/AiffLoader.d.ts +2 -0
- package/lib/aiff/AiffParser.d.ts +15 -0
- package/lib/aiff/AiffTagMap.d.ts +4 -0
- package/lib/aiff/AiffToken.d.ts +48 -0
- package/lib/apev2/APEv2Parser.d.ts +46 -0
- package/lib/apev2/APEv2TagMapper.d.ts +4 -0
- package/lib/apev2/APEv2Token.d.ts +99 -0
- package/lib/apev2/Apev2Loader.d.ts +2 -0
- package/lib/asf/AsfGuid.d.ts +83 -0
- package/lib/asf/AsfLoader.d.ts +2 -0
- package/lib/asf/AsfObject.d.ts +325 -0
- package/lib/asf/AsfParser.d.ts +17 -0
- package/lib/asf/AsfTagMapper.d.ts +7 -0
- package/lib/asf/AsfUtil.d.ts +4 -0
- package/lib/common/BasicParser.d.ts +17 -0
- package/lib/common/CaseInsensitiveTagMap.d.ts +10 -0
- package/lib/common/CombinedTagMapper.d.ts +19 -0
- package/lib/common/FourCC.d.ts +6 -0
- package/lib/common/GenericTagMapper.d.ts +51 -0
- package/lib/common/GenericTagTypes.d.ts +34 -0
- package/lib/common/MetadataCollector.d.ts +86 -0
- package/lib/common/Util.d.ts +56 -0
- package/lib/core.d.ts +75 -0
- package/lib/dsdiff/DsdiffLoader.d.ts +2 -0
- package/lib/dsdiff/DsdiffParser.d.ts +29 -0
- package/lib/dsdiff/DsdiffToken.d.ts +9 -0
- package/lib/dsf/DsfChunk.d.ts +87 -0
- package/lib/dsf/DsfLoader.d.ts +2 -0
- package/lib/dsf/DsfParser.d.ts +24 -0
- package/lib/ebml/EbmlIterator.d.ts +67 -0
- package/lib/ebml/types.d.ts +37 -0
- package/lib/flac/FlacLoader.d.ts +2 -0
- package/lib/flac/FlacParser.d.ts +29 -0
- package/lib/flac/FlacToken.d.ts +45 -0
- package/lib/id3v1/ID3v1Parser.d.ts +17 -0
- package/lib/id3v1/ID3v1TagMap.d.ts +4 -0
- package/lib/id3v2/AbstractID3Parser.d.ts +17 -0
- package/lib/id3v2/FrameHeader.d.ts +31 -0
- package/lib/id3v2/FrameParser.d.ts +92 -0
- package/lib/id3v2/ID3v22TagMapper.d.ts +9 -0
- package/lib/id3v2/ID3v24TagMapper.d.ts +14 -0
- package/lib/id3v2/ID3v2ChapterToken.d.ts +11 -0
- package/lib/id3v2/ID3v2Parser.d.ts +33 -0
- package/lib/id3v2/ID3v2Token.d.ts +111 -0
- package/lib/iff/index.d.ts +33 -0
- package/lib/index.d.ts +22 -0
- package/lib/lrc/LyricsParser.d.ts +9 -0
- package/lib/lyrics3/Lyrics3.d.ts +3 -0
- package/lib/matroska/MatroskaDtd.d.ts +8 -0
- package/lib/matroska/MatroskaLoader.d.ts +2 -0
- package/lib/matroska/MatroskaParser.d.ts +19 -0
- package/lib/matroska/MatroskaTagMapper.d.ts +4 -0
- package/lib/matroska/types.d.ts +142 -0
- package/lib/mp4/Atom.d.ts +16 -0
- package/lib/mp4/AtomToken.d.ts +487 -0
- package/lib/mp4/MP4Parser.d.ts +32 -0
- package/lib/mp4/MP4TagMapper.d.ts +8 -0
- package/lib/mp4/Mp4Loader.d.ts +2 -0
- package/lib/mpeg/ExtendedLameHeader.d.ts +27 -0
- package/lib/mpeg/MpegLoader.d.ts +2 -0
- package/lib/mpeg/MpegParser.d.ts +62 -0
- package/lib/mpeg/ReplayGainDataFormat.d.ts +57 -0
- package/lib/mpeg/XingTag.d.ts +44 -0
- package/lib/musepack/MusepackConentError.d.ts +15 -0
- package/lib/musepack/MusepackLoader.d.ts +2 -0
- package/lib/musepack/MusepackParser.d.ts +4 -0
- package/lib/musepack/sv7/BitReader.d.ts +13 -0
- package/lib/musepack/sv7/MpcSv7Parser.d.ts +8 -0
- package/lib/musepack/sv7/StreamVersion7.d.ts +28 -0
- package/lib/musepack/sv8/MpcSv8Parser.d.ts +6 -0
- package/lib/musepack/sv8/StreamVersion8.d.ts +42 -0
- package/lib/ogg/OggLoader.d.ts +2 -0
- package/lib/ogg/OggParser.d.ts +27 -0
- package/lib/ogg/OggToken.d.ts +83 -0
- package/lib/ogg/flac/FlacStream.d.ts +29 -0
- package/lib/ogg/opus/Opus.d.ts +63 -0
- package/lib/ogg/opus/OpusStream.d.ts +24 -0
- package/lib/ogg/speex/Speex.d.ts +36 -0
- package/lib/ogg/speex/SpeexStream.d.ts +20 -0
- package/lib/ogg/theora/Theora.d.ts +20 -0
- package/lib/ogg/theora/TheoraStream.d.ts +25 -0
- package/lib/ogg/vorbis/Vorbis.d.ts +68 -0
- package/lib/ogg/vorbis/VorbisDecoder.d.ts +12 -0
- package/lib/ogg/vorbis/VorbisStream.d.ts +53 -0
- package/lib/ogg/vorbis/VorbisTagMapper.d.ts +7 -0
- package/lib/riff/RiffChunk.d.ts +16 -0
- package/lib/riff/RiffInfoTagMap.d.ts +10 -0
- package/lib/type.d.ts +661 -0
- package/lib/wav/BwfChunk.d.ts +17 -0
- package/lib/wav/WaveChunk.d.ts +94 -0
- package/lib/wav/WaveLoader.d.ts +2 -0
- package/lib/wav/WaveParser.d.ts +24 -0
- package/lib/wavpack/WavPackLoader.d.ts +2 -0
- package/lib/wavpack/WavPackParser.d.ts +30 -0
- package/lib/wavpack/WavPackToken.d.ts +60 -0
- package/package.json +1 -1
|
@@ -0,0 +1,87 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,44 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,46 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,99 @@
|
|
|
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;
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
}
|