music-metadata 8.0.0 → 8.0.1
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 +48 -0
- package/lib/aiff/AiffParser.d.ts +14 -0
- package/lib/aiff/AiffToken.d.ts +23 -0
- package/lib/apev2/APEv2Parser.d.ts +30 -0
- package/lib/apev2/APEv2TagMapper.d.ts +4 -0
- package/lib/apev2/APEv2Token.d.ts +100 -0
- package/lib/asf/AsfObject.d.ts +320 -0
- package/lib/asf/AsfParser.d.ts +17 -0
- package/lib/asf/AsfTagMapper.d.ts +7 -0
- package/lib/asf/AsfUtil.d.ts +14 -0
- package/lib/asf/GUID.d.ts +84 -0
- package/lib/browser.js +99 -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 +33 -0
- package/lib/common/MetadataCollector.d.ts +76 -0
- package/lib/common/RandomFileReader.d.ts +22 -0
- package/lib/common/RandomUint8ArrayReader.d.ts +18 -0
- package/lib/common/Util.d.ts +57 -0
- package/lib/core.d.ts +48 -0
- package/lib/dsdiff/DsdiffParser.d.ts +14 -0
- package/lib/dsdiff/DsdiffToken.d.ts +9 -0
- package/lib/dsf/DsfChunk.d.ts +86 -0
- package/lib/dsf/DsfParser.d.ts +9 -0
- package/lib/flac/FlacParser.d.ts +28 -0
- package/lib/id3v1/ID3v1Parser.d.ts +13 -0
- package/lib/id3v1/ID3v1TagMap.d.ts +4 -0
- package/lib/id3v2/AbstractID3Parser.d.ts +17 -0
- package/lib/id3v2/FrameParser.d.ts +31 -0
- package/lib/id3v2/ID3v22TagMapper.d.ts +9 -0
- package/lib/id3v2/ID3v24TagMapper.d.ts +14 -0
- package/lib/id3v2/ID3v2Parser.d.ts +28 -0
- package/lib/id3v2/ID3v2Token.d.ts +73 -0
- package/lib/iff/index.d.ts +33 -0
- package/lib/index.d.ts +21 -0
- package/lib/lyrics3/Lyrics3.d.ts +3 -0
- package/lib/matroska/MatroskaDtd.d.ts +8 -0
- package/lib/matroska/MatroskaParser.d.ts +37 -0
- package/lib/matroska/MatroskaTagMapper.d.ts +4 -0
- package/lib/matroska/types.d.ts +175 -0
- package/lib/mp4/Atom.d.ts +16 -0
- package/lib/mp4/AtomToken.d.ts +395 -0
- package/lib/mp4/MP4Parser.d.ts +30 -0
- package/lib/mp4/MP4TagMapper.d.ts +5 -0
- package/lib/mpeg/ExtendedLameHeader.d.ts +27 -0
- package/lib/mpeg/MpegParser.d.ts +49 -0
- package/lib/mpeg/ReplayGainDataFormat.d.ts +55 -0
- package/lib/mpeg/XingTag.d.ts +45 -0
- package/lib/musepack/index.d.ts +5 -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 +40 -0
- package/lib/ogg/Ogg.d.ts +72 -0
- package/lib/ogg/OggParser.d.ts +23 -0
- package/lib/ogg/opus/Opus.d.ts +48 -0
- package/lib/ogg/opus/OpusParser.d.ts +25 -0
- package/lib/ogg/speex/Speex.d.ts +36 -0
- package/lib/ogg/speex/SpeexParser.d.ts +22 -0
- package/lib/ogg/theora/Theora.d.ts +20 -0
- package/lib/ogg/theora/TheoraParser.d.ts +28 -0
- package/lib/ogg/vorbis/Vorbis.d.ts +69 -0
- package/lib/ogg/vorbis/VorbisDecoder.d.ts +12 -0
- package/lib/ogg/vorbis/VorbisParser.d.ts +36 -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 +593 -0
- package/lib/wav/BwfChunk.d.ts +17 -0
- package/lib/wav/WaveChunk.d.ts +64 -0
- package/lib/wav/WaveParser.d.ts +24 -0
- package/lib/wavpack/WavPackParser.d.ts +14 -0
- package/lib/wavpack/WavPackToken.d.ts +64 -0
- package/package.json +3 -3
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ID3v2MajorVersion } from './ID3v2Token.js';
|
|
2
|
+
import { IWarningCollector } from '../common/MetadataCollector.js';
|
|
3
|
+
export declare function parseGenre(origVal: string): string[];
|
|
4
|
+
export declare class FrameParser {
|
|
5
|
+
private major;
|
|
6
|
+
private warningCollector;
|
|
7
|
+
/**
|
|
8
|
+
* Create id3v2 frame parser
|
|
9
|
+
* @param major - Major version, e.g. (4) for id3v2.4
|
|
10
|
+
* @param warningCollector - Used to collect decode issue
|
|
11
|
+
*/
|
|
12
|
+
constructor(major: ID3v2MajorVersion, warningCollector: IWarningCollector);
|
|
13
|
+
readData(uint8Array: Uint8Array, type: string, includeCovers: boolean): any;
|
|
14
|
+
protected static fixPictureMimeType(pictureType: string): string;
|
|
15
|
+
/**
|
|
16
|
+
* Converts TMCL (Musician credits list) or TIPL (Involved people list)
|
|
17
|
+
* @param entries
|
|
18
|
+
*/
|
|
19
|
+
private static functionList;
|
|
20
|
+
/**
|
|
21
|
+
* id3v2.4 defines that multiple T* values are separated by 0x00
|
|
22
|
+
* id3v2.3 defines that TCOM, TEXT, TOLY, TOPE & TPE1 values are separated by /
|
|
23
|
+
* @param tag - Tag name
|
|
24
|
+
* @param text - Concatenated tag value
|
|
25
|
+
* @returns Split tag value
|
|
26
|
+
*/
|
|
27
|
+
private splitValue;
|
|
28
|
+
private static trimArray;
|
|
29
|
+
private static readIdentifierAndData;
|
|
30
|
+
private static getNullTerminatorLength;
|
|
31
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { INativeTagMap } from '../common/GenericTagTypes.js';
|
|
2
|
+
import { CaseInsensitiveTagMap } from '../common/CaseInsensitiveTagMap.js';
|
|
3
|
+
/**
|
|
4
|
+
* ID3v2.2 tag mappings
|
|
5
|
+
*/
|
|
6
|
+
export declare const id3v22TagMap: INativeTagMap;
|
|
7
|
+
export declare class ID3v22TagMapper extends CaseInsensitiveTagMap {
|
|
8
|
+
constructor();
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CaseInsensitiveTagMap } from '../common/CaseInsensitiveTagMap.js';
|
|
2
|
+
import { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
3
|
+
import { IRating, ITag } from '../type.js';
|
|
4
|
+
export declare class ID3v24TagMapper extends CaseInsensitiveTagMap {
|
|
5
|
+
static toRating(popm: any): IRating;
|
|
6
|
+
constructor();
|
|
7
|
+
/**
|
|
8
|
+
* Handle post mapping exceptions / correction
|
|
9
|
+
* @param tag to post map
|
|
10
|
+
* @param warnings Wil be used to register (collect) warnings
|
|
11
|
+
* @return Common value e.g. "Buena Vista Social Club"
|
|
12
|
+
*/
|
|
13
|
+
protected postMap(tag: ITag, warnings: INativeMetadataCollector): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ITokenizer } from 'strtok3/core';
|
|
2
|
+
import { IOptions } from '../type.js';
|
|
3
|
+
import { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
4
|
+
export declare class ID3v2Parser {
|
|
5
|
+
static removeUnsyncBytes(buffer: Uint8Array): Uint8Array;
|
|
6
|
+
private static getFrameHeaderLength;
|
|
7
|
+
private static readFrameFlags;
|
|
8
|
+
private static readFrameData;
|
|
9
|
+
/**
|
|
10
|
+
* Create a combined tag key, of tag & description
|
|
11
|
+
* @param tag e.g.: COM
|
|
12
|
+
* @param description e.g. iTunPGAP
|
|
13
|
+
* @returns string e.g. COM:iTunPGAP
|
|
14
|
+
*/
|
|
15
|
+
private static makeDescriptionTagName;
|
|
16
|
+
private tokenizer;
|
|
17
|
+
private id3Header;
|
|
18
|
+
private metadata;
|
|
19
|
+
private headerType;
|
|
20
|
+
private options;
|
|
21
|
+
parse(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): Promise<void>;
|
|
22
|
+
parseExtendedHeader(): Promise<void>;
|
|
23
|
+
parseExtendedHeaderData(dataRemaining: number, extendedHeaderSize: number): Promise<void>;
|
|
24
|
+
parseId3Data(dataLen: number): Promise<void>;
|
|
25
|
+
private addTag;
|
|
26
|
+
private parseMetadata;
|
|
27
|
+
private readFrameHeader;
|
|
28
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { IGetToken } from 'strtok3/core';
|
|
2
|
+
import * as util from '../common/Util.js';
|
|
3
|
+
/**
|
|
4
|
+
* The picture type according to the ID3v2 APIC frame
|
|
5
|
+
* Ref: http://id3.org/id3v2.3.0#Attached_picture
|
|
6
|
+
*/
|
|
7
|
+
export declare enum AttachedPictureType {
|
|
8
|
+
'Other' = 0,
|
|
9
|
+
"32x32 pixels 'file icon' (PNG only)" = 1,
|
|
10
|
+
'Other file icon' = 2,
|
|
11
|
+
'Cover (front)' = 3,
|
|
12
|
+
'Cover (back)' = 4,
|
|
13
|
+
'Leaflet page' = 5,
|
|
14
|
+
'Media (e.g. label side of CD)' = 6,
|
|
15
|
+
'Lead artist/lead performer/soloist' = 7,
|
|
16
|
+
'Artist/performer' = 8,
|
|
17
|
+
'Conductor' = 9,
|
|
18
|
+
'Band/Orchestra' = 10,
|
|
19
|
+
'Composer' = 11,
|
|
20
|
+
'Lyricist/text writer' = 12,
|
|
21
|
+
'Recording Location' = 13,
|
|
22
|
+
'During recording' = 14,
|
|
23
|
+
'During performance' = 15,
|
|
24
|
+
'Movie/video screen capture' = 16,
|
|
25
|
+
'A bright coloured fish' = 17,
|
|
26
|
+
'Illustration' = 18,
|
|
27
|
+
'Band/artist logotype' = 19,
|
|
28
|
+
'Publisher/Studio logotype' = 20
|
|
29
|
+
}
|
|
30
|
+
export declare type ID3v2MajorVersion = 2 | 3 | 4;
|
|
31
|
+
export interface IExtendedHeader {
|
|
32
|
+
size: number;
|
|
33
|
+
extendedFlags: number;
|
|
34
|
+
sizeOfPadding: number;
|
|
35
|
+
crcDataPresent: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 28 bits (representing up to 256MB) integer, the msb is 0 to avoid 'false syncsignals'.
|
|
39
|
+
* 4 * %0xxxxxxx
|
|
40
|
+
*/
|
|
41
|
+
export declare const UINT32SYNCSAFE: {
|
|
42
|
+
get: (buf: Uint8Array, off: number) => number;
|
|
43
|
+
len: number;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* ID3v2 tag header
|
|
47
|
+
*/
|
|
48
|
+
export interface IID3v2header {
|
|
49
|
+
fileIdentifier: string;
|
|
50
|
+
version: {
|
|
51
|
+
major: ID3v2MajorVersion;
|
|
52
|
+
revision: number;
|
|
53
|
+
};
|
|
54
|
+
flags: {
|
|
55
|
+
unsynchronisation: boolean;
|
|
56
|
+
isExtendedHeader: boolean;
|
|
57
|
+
expIndicator: boolean;
|
|
58
|
+
footer: boolean;
|
|
59
|
+
};
|
|
60
|
+
size: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* ID3v2 header
|
|
64
|
+
* Ref: http://id3.org/id3v2.3.0#ID3v2_header
|
|
65
|
+
* ToDo
|
|
66
|
+
*/
|
|
67
|
+
export declare const ID3v2Header: IGetToken<IID3v2header>;
|
|
68
|
+
export declare const ExtendedHeader: IGetToken<IExtendedHeader>;
|
|
69
|
+
export interface ITextEncoding {
|
|
70
|
+
encoding: util.StringEncoding;
|
|
71
|
+
bom?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export declare const TextEncodingToken: IGetToken<ITextEncoding>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IGetToken } from 'strtok3/core';
|
|
2
|
+
/**
|
|
3
|
+
* "EA IFF 85" Standard for Interchange Format Files
|
|
4
|
+
* Ref: http://www.martinreddy.net/gfx/2d/IFF.txt
|
|
5
|
+
*/
|
|
6
|
+
export interface IChunkHeader {
|
|
7
|
+
/**
|
|
8
|
+
* A chunk ID (ie, 4 ASCII bytes)
|
|
9
|
+
*/
|
|
10
|
+
chunkID: string;
|
|
11
|
+
/**
|
|
12
|
+
* Number of data bytes following this data header
|
|
13
|
+
*/
|
|
14
|
+
chunkSize: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* "EA IFF 85" Standard for Interchange Format Files
|
|
18
|
+
* Ref: http://www.martinreddy.net/gfx/2d/IFF.txt
|
|
19
|
+
*/
|
|
20
|
+
export interface IChunkHeader64 {
|
|
21
|
+
/**
|
|
22
|
+
* A chunk ID (ie, 4 ASCII bytes)
|
|
23
|
+
*/
|
|
24
|
+
chunkID: string;
|
|
25
|
+
/**
|
|
26
|
+
* Number of data bytes following this data header
|
|
27
|
+
*/
|
|
28
|
+
chunkSize: bigint;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Common AIFF chunk header
|
|
32
|
+
*/
|
|
33
|
+
export declare const Header: IGetToken<IChunkHeader>;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import * as Stream from 'stream';
|
|
3
|
+
import * as strtok3 from 'strtok3';
|
|
4
|
+
import { IAudioMetadata, IOptions } from './type.js';
|
|
5
|
+
export { IAudioMetadata, IOptions, ITag, INativeTagDict, ICommonTagsResult, IFormat, IPicture, IRatio, IChapter } from './type.js';
|
|
6
|
+
export { parseFromTokenizer, parseBuffer, selectCover, orderTags, ratingToStars, IFileInfo } from './core.js';
|
|
7
|
+
/**
|
|
8
|
+
* Parse audio from Node Stream.Readable
|
|
9
|
+
* @param stream - Stream to read the audio track from
|
|
10
|
+
* @param fileInfo - File information object or MIME-type, e.g.: 'audio/mpeg'
|
|
11
|
+
* @param options - Parsing options
|
|
12
|
+
* @returns Metadata
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseStream(stream: Stream.Readable, fileInfo?: strtok3.IFileInfo | string, options?: IOptions): Promise<IAudioMetadata>;
|
|
15
|
+
/**
|
|
16
|
+
* Parse audio from Node file
|
|
17
|
+
* @param filePath - Media file to read meta-data from
|
|
18
|
+
* @param options - Parsing options
|
|
19
|
+
* @returns Metadata
|
|
20
|
+
*/
|
|
21
|
+
export declare function parseFile(filePath: string, options?: IOptions): Promise<IAudioMetadata>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IContainerType } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Elements of document type description
|
|
4
|
+
* Derived from https://github.com/tungol/EBML/blob/master/doctypes/matroska.dtd
|
|
5
|
+
* Extended with:
|
|
6
|
+
* - https://www.matroska.org/technical/specs/index.html
|
|
7
|
+
*/
|
|
8
|
+
export declare const elements: IContainerType;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ITokenizer } from 'strtok3/core';
|
|
2
|
+
import { INativeMetadataCollector } from '../common/MetadataCollector.js';
|
|
3
|
+
import { BasicParser } from '../common/BasicParser.js';
|
|
4
|
+
import { IOptions } from '../type.js';
|
|
5
|
+
import { ITokenParser } from '../ParserFactory.js';
|
|
6
|
+
/**
|
|
7
|
+
* Extensible Binary Meta Language (EBML) parser
|
|
8
|
+
* https://en.wikipedia.org/wiki/Extensible_Binary_Meta_Language
|
|
9
|
+
* http://matroska.sourceforge.net/technical/specs/rfc/index.html
|
|
10
|
+
*
|
|
11
|
+
* WEBM VP8 AUDIO FILE
|
|
12
|
+
*/
|
|
13
|
+
export declare class MatroskaParser extends BasicParser {
|
|
14
|
+
private padding;
|
|
15
|
+
private parserMap;
|
|
16
|
+
private ebmlMaxIDLength;
|
|
17
|
+
private ebmlMaxSizeLength;
|
|
18
|
+
constructor();
|
|
19
|
+
/**
|
|
20
|
+
* Initialize parser with output (metadata), input (tokenizer) & parsing options (options).
|
|
21
|
+
* @param {INativeMetadataCollector} metadata Output
|
|
22
|
+
* @param {ITokenizer} tokenizer Input
|
|
23
|
+
* @param {IOptions} options Parsing options
|
|
24
|
+
*/
|
|
25
|
+
init(metadata: INativeMetadataCollector, tokenizer: ITokenizer, options: IOptions): ITokenParser;
|
|
26
|
+
parse(): Promise<void>;
|
|
27
|
+
private parseContainer;
|
|
28
|
+
private readVintData;
|
|
29
|
+
private readElement;
|
|
30
|
+
private isMaxValue;
|
|
31
|
+
private readFloat;
|
|
32
|
+
private readFlag;
|
|
33
|
+
private readUint;
|
|
34
|
+
private readString;
|
|
35
|
+
private readBuffer;
|
|
36
|
+
private addTag;
|
|
37
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
export interface IHeader {
|
|
3
|
+
id: number;
|
|
4
|
+
len: number;
|
|
5
|
+
}
|
|
6
|
+
export declare enum DataType {
|
|
7
|
+
'string' = 0,
|
|
8
|
+
uint = 1,
|
|
9
|
+
uid = 2,
|
|
10
|
+
bool = 3,
|
|
11
|
+
binary = 4,
|
|
12
|
+
float = 5
|
|
13
|
+
}
|
|
14
|
+
export interface IElementType<T> {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
readonly value?: DataType;
|
|
17
|
+
readonly container?: IContainerType;
|
|
18
|
+
readonly multiple?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface IContainerType {
|
|
21
|
+
[id: number]: IElementType<string | number | boolean | Buffer>;
|
|
22
|
+
}
|
|
23
|
+
export interface ITree {
|
|
24
|
+
[name: string]: string | number | boolean | Buffer | ITree | ITree[];
|
|
25
|
+
}
|
|
26
|
+
export interface ISeekHead {
|
|
27
|
+
id?: Buffer;
|
|
28
|
+
position?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface IMetaSeekInformation {
|
|
31
|
+
seekHeads: ISeekHead[];
|
|
32
|
+
}
|
|
33
|
+
export interface ISegmentInformation {
|
|
34
|
+
uid?: Buffer;
|
|
35
|
+
timecodeScale?: number;
|
|
36
|
+
duration?: number;
|
|
37
|
+
dateUTC?: number;
|
|
38
|
+
title?: string;
|
|
39
|
+
muxingApp?: string;
|
|
40
|
+
writingApp?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface ITrackEntry {
|
|
43
|
+
uid?: Buffer;
|
|
44
|
+
trackNumber?: number;
|
|
45
|
+
trackType?: TrackType;
|
|
46
|
+
audio?: ITrackAudio;
|
|
47
|
+
video?: ITrackVideo;
|
|
48
|
+
flagEnabled?: boolean;
|
|
49
|
+
flagDefault?: boolean;
|
|
50
|
+
flagLacing?: boolean;
|
|
51
|
+
defaultDuration?: number;
|
|
52
|
+
trackTimecodeScale?: number;
|
|
53
|
+
name?: string;
|
|
54
|
+
language?: string;
|
|
55
|
+
codecID?: string;
|
|
56
|
+
codecPrivate?: Buffer;
|
|
57
|
+
codecName?: string;
|
|
58
|
+
codecSettings?: string;
|
|
59
|
+
codecInfoUrl?: string;
|
|
60
|
+
codecDownloadUrl?: string;
|
|
61
|
+
codecDecodeAll?: string;
|
|
62
|
+
trackOverlay?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface ITrackVideo {
|
|
65
|
+
flagInterlaced?: boolean;
|
|
66
|
+
stereoMode?: number;
|
|
67
|
+
pixelWidth?: number;
|
|
68
|
+
pixelHeight?: number;
|
|
69
|
+
displayWidth?: number;
|
|
70
|
+
displayHeight?: number;
|
|
71
|
+
displayUnit?: number;
|
|
72
|
+
aspectRatioType?: number;
|
|
73
|
+
colourSpace?: Buffer;
|
|
74
|
+
gammaValue?: number;
|
|
75
|
+
}
|
|
76
|
+
export interface ITrackAudio {
|
|
77
|
+
samplingFrequency?: number;
|
|
78
|
+
outputSamplingFrequency?: number;
|
|
79
|
+
channels?: number;
|
|
80
|
+
channelPositions?: Buffer;
|
|
81
|
+
bitDepth?: number;
|
|
82
|
+
}
|
|
83
|
+
export interface ICuePoint {
|
|
84
|
+
cueTime?: number;
|
|
85
|
+
cueTrackPositions: ICueTrackPosition[];
|
|
86
|
+
}
|
|
87
|
+
export interface ICueTrackPosition {
|
|
88
|
+
cueTrack?: number;
|
|
89
|
+
cueClusterPosition?: number;
|
|
90
|
+
cueBlockNumber?: number;
|
|
91
|
+
cueCodecState?: number;
|
|
92
|
+
cueReference?: ICueReference;
|
|
93
|
+
}
|
|
94
|
+
export interface ICueReference {
|
|
95
|
+
cueRefTime?: number;
|
|
96
|
+
cueRefCluster?: number;
|
|
97
|
+
cueRefNumber?: number;
|
|
98
|
+
cueRefCodecState?: number;
|
|
99
|
+
}
|
|
100
|
+
export interface ISimpleTag {
|
|
101
|
+
name?: string;
|
|
102
|
+
'string'?: string;
|
|
103
|
+
binary?: Buffer;
|
|
104
|
+
language?: string;
|
|
105
|
+
default?: boolean;
|
|
106
|
+
}
|
|
107
|
+
export declare enum TargetType {
|
|
108
|
+
shot = 10,
|
|
109
|
+
scene = 20,
|
|
110
|
+
track = 30,
|
|
111
|
+
part = 40,
|
|
112
|
+
album = 50,
|
|
113
|
+
edition = 60,
|
|
114
|
+
collection = 70
|
|
115
|
+
}
|
|
116
|
+
export declare enum TrackType {
|
|
117
|
+
video = 1,
|
|
118
|
+
audio = 2,
|
|
119
|
+
complex = 3,
|
|
120
|
+
logo = 4,
|
|
121
|
+
subtitle = 17,
|
|
122
|
+
button = 18,
|
|
123
|
+
control = 32
|
|
124
|
+
}
|
|
125
|
+
export interface ITarget {
|
|
126
|
+
trackUID?: Buffer;
|
|
127
|
+
chapterUID?: Buffer;
|
|
128
|
+
attachmentUID?: Buffer;
|
|
129
|
+
targetTypeValue?: TargetType;
|
|
130
|
+
targetType?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface ITag {
|
|
133
|
+
target: ITarget;
|
|
134
|
+
simpleTags: ISimpleTag[];
|
|
135
|
+
}
|
|
136
|
+
export interface ITags {
|
|
137
|
+
tag: ITag[];
|
|
138
|
+
}
|
|
139
|
+
export interface ITrackElement {
|
|
140
|
+
entries?: ITrackEntry[];
|
|
141
|
+
}
|
|
142
|
+
export interface IAttachmedFile {
|
|
143
|
+
description?: string;
|
|
144
|
+
name: string;
|
|
145
|
+
mimeType: string;
|
|
146
|
+
data: Buffer;
|
|
147
|
+
uid: string;
|
|
148
|
+
}
|
|
149
|
+
export interface IAttachments {
|
|
150
|
+
attachedFiles?: IAttachmedFile[];
|
|
151
|
+
}
|
|
152
|
+
export interface IMatroskaSegment {
|
|
153
|
+
metaSeekInfo?: IMetaSeekInformation;
|
|
154
|
+
seekHeads?: ISeekHead[];
|
|
155
|
+
info?: ISegmentInformation;
|
|
156
|
+
tracks?: ITrackElement;
|
|
157
|
+
tags?: ITags;
|
|
158
|
+
cues?: ICuePoint[];
|
|
159
|
+
attachments?: IAttachments;
|
|
160
|
+
}
|
|
161
|
+
export interface IEbmlElements {
|
|
162
|
+
version?: number;
|
|
163
|
+
readVersion?: number;
|
|
164
|
+
maxIDWidth?: number;
|
|
165
|
+
maxSizeWidth?: number;
|
|
166
|
+
docType?: string;
|
|
167
|
+
docTypeVersion?: number;
|
|
168
|
+
docTypeReadVersion?: number;
|
|
169
|
+
}
|
|
170
|
+
export interface IEbmlDoc {
|
|
171
|
+
ebml: IEbmlElements;
|
|
172
|
+
}
|
|
173
|
+
export interface IMatroskaDoc extends IEbmlDoc {
|
|
174
|
+
segment: IMatroskaSegment;
|
|
175
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as AtomToken from './AtomToken.js';
|
|
2
|
+
import { ITokenizer } from 'strtok3/core';
|
|
3
|
+
export declare type AtomDataHandler = (atom: Atom, remaining: number) => Promise<void>;
|
|
4
|
+
export declare class Atom {
|
|
5
|
+
readonly header: AtomToken.IAtomHeader;
|
|
6
|
+
extended: boolean;
|
|
7
|
+
readonly parent: Atom;
|
|
8
|
+
static readAtom(tokenizer: ITokenizer, dataHandler: AtomDataHandler, parent: Atom, remaining: number): Promise<Atom>;
|
|
9
|
+
readonly children: Atom[];
|
|
10
|
+
readonly atomPath: string;
|
|
11
|
+
constructor(header: AtomToken.IAtomHeader, extended: boolean, parent: Atom);
|
|
12
|
+
getHeaderLength(): number;
|
|
13
|
+
getPayloadLength(remaining: number): number;
|
|
14
|
+
readAtoms(tokenizer: ITokenizer, dataHandler: AtomDataHandler, size: number): Promise<void>;
|
|
15
|
+
private readData;
|
|
16
|
+
}
|