music-metadata 7.12.4 → 8.0.0
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/README.md +47 -31
- package/lib/ParserFactory.js +37 -41
- package/lib/aiff/AiffParser.js +25 -17
- package/lib/aiff/AiffToken.js +13 -12
- package/lib/apev2/APEv2Parser.js +29 -32
- package/lib/apev2/APEv2TagMapper.js +2 -6
- package/lib/apev2/APEv2Token.js +13 -19
- package/lib/asf/AsfObject.js +42 -56
- package/lib/asf/AsfParser.js +15 -19
- package/lib/asf/AsfTagMapper.js +2 -6
- package/lib/asf/AsfUtil.js +4 -7
- package/lib/asf/GUID.js +1 -4
- package/lib/common/BasicParser.js +1 -5
- package/lib/common/CaseInsensitiveTagMap.js +2 -6
- package/lib/common/CombinedTagMapper.js +20 -24
- package/lib/common/FourCC.js +3 -6
- package/lib/common/GenericTagMapper.js +2 -6
- package/lib/common/GenericTagTypes.js +5 -10
- package/lib/common/MetadataCollector.js +20 -25
- package/lib/common/RandomFileReader.js +2 -6
- package/lib/common/RandomUint8ArrayReader.js +1 -5
- package/lib/common/Util.js +11 -25
- package/lib/core.js +18 -28
- package/lib/dsdiff/DsdiffParser.js +24 -28
- package/lib/dsdiff/DsdiffToken.js +4 -7
- package/lib/dsf/DsfChunk.js +8 -11
- package/lib/dsf/DsfParser.js +13 -17
- package/lib/flac/FlacParser.js +22 -26
- package/lib/id3v1/ID3v1Parser.js +16 -21
- package/lib/id3v1/ID3v1TagMap.js +2 -6
- package/lib/id3v2/AbstractID3Parser.js +13 -17
- package/lib/id3v2/FrameParser.js +12 -17
- package/lib/id3v2/ID3v22TagMapper.js +4 -8
- package/lib/id3v2/ID3v24TagMapper.js +5 -9
- package/lib/id3v2/ID3v2Parser.js +10 -14
- package/lib/id3v2/ID3v2Token.js +9 -12
- package/lib/iff/index.js +4 -7
- package/lib/index.js +14 -44
- package/lib/lyrics3/Lyrics3.js +3 -7
- package/lib/matroska/MatroskaDtd.js +111 -114
- package/lib/matroska/MatroskaParser.js +20 -24
- package/lib/matroska/MatroskaTagMapper.js +2 -6
- package/lib/matroska/types.js +6 -9
- package/lib/mp4/Atom.js +4 -8
- package/lib/mp4/AtomToken.js +29 -44
- package/lib/mp4/MP4Parser.js +12 -16
- package/lib/mp4/MP4TagMapper.js +4 -8
- package/lib/mpeg/ExtendedLameHeader.js +6 -9
- package/lib/mpeg/MpegParser.js +17 -21
- package/lib/mpeg/ReplayGainDataFormat.js +2 -5
- package/lib/mpeg/XingTag.js +9 -13
- package/lib/musepack/index.js +10 -12
- package/lib/musepack/sv7/BitReader.js +2 -6
- package/lib/musepack/sv7/MpcSv7Parser.js +9 -13
- package/lib/musepack/sv7/StreamVersion7.js +3 -6
- package/lib/musepack/sv8/MpcSv8Parser.js +9 -13
- package/lib/musepack/sv8/StreamVersion8.js +5 -9
- package/lib/ogg/Ogg.js +1 -2
- package/lib/ogg/OggParser.js +19 -24
- package/lib/ogg/opus/Opus.js +2 -6
- package/lib/ogg/opus/OpusParser.js +4 -8
- package/lib/ogg/speex/Speex.js +3 -6
- package/lib/ogg/speex/SpeexParser.js +5 -9
- package/lib/ogg/theora/Theora.js +2 -5
- package/lib/ogg/theora/TheoraParser.js +5 -9
- package/lib/ogg/vorbis/Vorbis.js +6 -10
- package/lib/ogg/vorbis/VorbisDecoder.js +2 -6
- package/lib/ogg/vorbis/VorbisParser.js +18 -22
- package/lib/ogg/vorbis/VorbisTagMapper.js +3 -7
- package/lib/riff/RiffChunk.js +3 -7
- package/lib/riff/RiffInfoTagMap.js +4 -8
- package/lib/type.js +1 -5
- package/lib/wav/BwfChunk.js +8 -11
- package/lib/wav/WaveChunk.js +4 -9
- package/lib/wav/WaveParser.js +17 -21
- package/lib/wavpack/WavPackParser.js +17 -21
- package/lib/wavpack/WavPackToken.js +4 -8
- package/package.json +34 -44
- package/lib/ParserFactory.d.ts +0 -48
- package/lib/aiff/AiffParser.d.ts +0 -14
- package/lib/aiff/AiffToken.d.ts +0 -22
- package/lib/apev2/APEv2Parser.d.ts +0 -30
- package/lib/apev2/APEv2TagMapper.d.ts +0 -4
- package/lib/apev2/APEv2Token.d.ts +0 -100
- package/lib/asf/AsfObject.d.ts +0 -319
- package/lib/asf/AsfParser.d.ts +0 -17
- package/lib/asf/AsfTagMapper.d.ts +0 -7
- package/lib/asf/AsfUtil.d.ts +0 -13
- package/lib/asf/GUID.d.ts +0 -84
- 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 -33
- package/lib/common/MetadataCollector.d.ts +0 -76
- package/lib/common/RandomFileReader.d.ts +0 -22
- package/lib/common/RandomUint8ArrayReader.d.ts +0 -18
- package/lib/common/Util.d.ts +0 -57
- package/lib/core.d.ts +0 -48
- package/lib/dsdiff/DsdiffParser.d.ts +0 -14
- package/lib/dsdiff/DsdiffToken.d.ts +0 -9
- package/lib/dsf/DsfChunk.d.ts +0 -86
- package/lib/dsf/DsfParser.d.ts +0 -9
- package/lib/flac/FlacParser.d.ts +0 -28
- package/lib/id3v1/ID3v1Parser.d.ts +0 -13
- package/lib/id3v1/ID3v1TagMap.d.ts +0 -4
- package/lib/id3v2/AbstractID3Parser.d.ts +0 -17
- package/lib/id3v2/FrameParser.d.ts +0 -31
- package/lib/id3v2/ID3v22TagMapper.d.ts +0 -9
- package/lib/id3v2/ID3v24TagMapper.d.ts +0 -14
- package/lib/id3v2/ID3v2Parser.d.ts +0 -28
- package/lib/id3v2/ID3v2Token.d.ts +0 -73
- package/lib/iff/index.d.ts +0 -33
- package/lib/index.d.ts +0 -45
- package/lib/lyrics3/Lyrics3.d.ts +0 -3
- package/lib/matroska/MatroskaDtd.d.ts +0 -8
- package/lib/matroska/MatroskaParser.d.ts +0 -37
- package/lib/matroska/MatroskaTagMapper.d.ts +0 -4
- package/lib/matroska/types.d.ts +0 -175
- package/lib/mp4/Atom.d.ts +0 -16
- package/lib/mp4/AtomToken.d.ts +0 -395
- package/lib/mp4/MP4Parser.d.ts +0 -30
- package/lib/mp4/MP4TagMapper.d.ts +0 -5
- package/lib/mpeg/ExtendedLameHeader.d.ts +0 -27
- package/lib/mpeg/MpegParser.d.ts +0 -49
- package/lib/mpeg/ReplayGainDataFormat.d.ts +0 -55
- package/lib/mpeg/XingTag.d.ts +0 -45
- package/lib/musepack/index.d.ts +0 -5
- 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 -40
- package/lib/ogg/Ogg.d.ts +0 -72
- package/lib/ogg/OggParser.d.ts +0 -23
- package/lib/ogg/opus/Opus.d.ts +0 -48
- package/lib/ogg/opus/OpusParser.d.ts +0 -25
- package/lib/ogg/speex/Speex.d.ts +0 -36
- package/lib/ogg/speex/SpeexParser.d.ts +0 -22
- package/lib/ogg/theora/Theora.d.ts +0 -20
- package/lib/ogg/theora/TheoraParser.d.ts +0 -28
- package/lib/ogg/vorbis/Vorbis.d.ts +0 -69
- package/lib/ogg/vorbis/VorbisDecoder.d.ts +0 -12
- package/lib/ogg/vorbis/VorbisParser.d.ts +0 -36
- 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 -592
- package/lib/wav/BwfChunk.d.ts +0 -17
- package/lib/wav/WaveChunk.d.ts +0 -64
- package/lib/wav/WaveParser.d.ts +0 -24
- package/lib/wavpack/WavPackParser.d.ts +0 -14
- package/lib/wavpack/WavPackToken.d.ts +0 -64
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
export interface IReplayGain {
|
|
3
|
-
type: NameCode;
|
|
4
|
-
origin: ReplayGainOriginator;
|
|
5
|
-
adjustment: number;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#name-code
|
|
9
|
-
*/
|
|
10
|
-
declare enum NameCode {
|
|
11
|
-
/**
|
|
12
|
-
* not set
|
|
13
|
-
*/
|
|
14
|
-
not_set = 0,
|
|
15
|
-
/**
|
|
16
|
-
* Radio Gain Adjustment
|
|
17
|
-
*/
|
|
18
|
-
radio = 1,
|
|
19
|
-
/**
|
|
20
|
-
* Audiophile Gain Adjustment
|
|
21
|
-
*/
|
|
22
|
-
audiophile = 2
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format#originator-code
|
|
26
|
-
*/
|
|
27
|
-
declare enum ReplayGainOriginator {
|
|
28
|
-
/**
|
|
29
|
-
* Replay Gain unspecified
|
|
30
|
-
*/
|
|
31
|
-
unspecified = 0,
|
|
32
|
-
/**
|
|
33
|
-
* Replay Gain pre-set by artist/producer/mastering engineer
|
|
34
|
-
*/
|
|
35
|
-
engineer = 1,
|
|
36
|
-
/**
|
|
37
|
-
* Replay Gain set by user
|
|
38
|
-
*/
|
|
39
|
-
user = 2,
|
|
40
|
-
/**
|
|
41
|
-
* Replay Gain determined automatically, as described on this site
|
|
42
|
-
*/
|
|
43
|
-
automatic = 3,
|
|
44
|
-
/**
|
|
45
|
-
* Set by simple RMS average
|
|
46
|
-
*/
|
|
47
|
-
rms_average = 4
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Replay Gain Data Format
|
|
51
|
-
*
|
|
52
|
-
* https://github.com/Borewit/music-metadata/wiki/Replay-Gain-Data-Format
|
|
53
|
-
*/
|
|
54
|
-
export declare const ReplayGain: IGetToken<IReplayGain>;
|
|
55
|
-
export {};
|
package/lib/mpeg/XingTag.d.ts
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as Token from 'token-types';
|
|
3
|
-
import { IGetToken, ITokenizer } from 'strtok3/lib/core';
|
|
4
|
-
import { IExtendedLameHeader } from './ExtendedLameHeader';
|
|
5
|
-
export interface IXingHeaderFlags {
|
|
6
|
-
frames: boolean;
|
|
7
|
-
bytes: boolean;
|
|
8
|
-
toc: boolean;
|
|
9
|
-
vbrScale: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Info Tag: Xing, LAME
|
|
13
|
-
*/
|
|
14
|
-
export declare const InfoTagHeaderTag: Token.StringType;
|
|
15
|
-
/**
|
|
16
|
-
* LAME TAG value
|
|
17
|
-
* Did not find any official documentation for this
|
|
18
|
-
* Value e.g.: "3.98.4"
|
|
19
|
-
*/
|
|
20
|
-
export declare const LameEncoderVersion: Token.StringType;
|
|
21
|
-
export interface IXingInfoTag {
|
|
22
|
-
/**
|
|
23
|
-
* total bit stream frames from Vbr header data
|
|
24
|
-
*/
|
|
25
|
-
numFrames?: number;
|
|
26
|
-
/**
|
|
27
|
-
* Actual stream size = file size - header(s) size [bytes]
|
|
28
|
-
*/
|
|
29
|
-
streamSize?: number;
|
|
30
|
-
toc?: Buffer;
|
|
31
|
-
/**
|
|
32
|
-
* the number of header data bytes (from original file)
|
|
33
|
-
*/
|
|
34
|
-
vbrScale?: number;
|
|
35
|
-
lame?: {
|
|
36
|
-
version: string;
|
|
37
|
-
extended?: IExtendedLameHeader;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Info Tag
|
|
42
|
-
* Ref: http://gabriel.mp3-tech.org/mp3infotag.html
|
|
43
|
-
*/
|
|
44
|
-
export declare const XingHeaderFlags: IGetToken<IXingHeaderFlags>;
|
|
45
|
-
export declare function readXingHeader(tokenizer: ITokenizer): Promise<IXingInfoTag>;
|
package/lib/musepack/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ITokenizer } from 'strtok3/lib/core';
|
|
2
|
-
export declare class BitReader {
|
|
3
|
-
private tokenizer;
|
|
4
|
-
pos: number;
|
|
5
|
-
private dword;
|
|
6
|
-
constructor(tokenizer: ITokenizer);
|
|
7
|
-
/**
|
|
8
|
-
*
|
|
9
|
-
* @param bits 1..30 bits
|
|
10
|
-
*/
|
|
11
|
-
read(bits: number): Promise<number>;
|
|
12
|
-
ignore(bits: number): Promise<number>;
|
|
13
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
/**
|
|
3
|
-
* MusePack stream version 7 format specification
|
|
4
|
-
* http://trac.musepack.net/musepack/wiki/SV7Specification
|
|
5
|
-
*/
|
|
6
|
-
export interface IHeader {
|
|
7
|
-
signature: string;
|
|
8
|
-
streamMinorVersion: number;
|
|
9
|
-
streamMajorVersion: number;
|
|
10
|
-
frameCount: number;
|
|
11
|
-
intensityStereo: boolean;
|
|
12
|
-
midSideStereo: boolean;
|
|
13
|
-
maxBand: number;
|
|
14
|
-
profile: number;
|
|
15
|
-
link: number;
|
|
16
|
-
sampleFrequency: number;
|
|
17
|
-
maxLevel: number;
|
|
18
|
-
titleGain: number;
|
|
19
|
-
titlePeak: number;
|
|
20
|
-
albumGain: number;
|
|
21
|
-
albumPeak: number;
|
|
22
|
-
trueGapless: boolean;
|
|
23
|
-
lastFrameLength: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* BASIC STRUCTURE
|
|
27
|
-
*/
|
|
28
|
-
export declare const Header: IGetToken<IHeader>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { ITokenizer } from 'strtok3/lib/core';
|
|
2
|
-
export interface IPacketHeader {
|
|
3
|
-
key: string;
|
|
4
|
-
payloadLength: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Stream Header Packet
|
|
8
|
-
* Ref: http://trac.musepack.net/musepack/wiki/SV8Specification#StreamHeaderPacket
|
|
9
|
-
*/
|
|
10
|
-
interface IStreamHeader1 {
|
|
11
|
-
crc: number;
|
|
12
|
-
streamVersion: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Stream Header Packet
|
|
16
|
-
* Ref: http://trac.musepack.net/musepack/wiki/SV8Specification#StreamHeaderPacket
|
|
17
|
-
*/
|
|
18
|
-
interface IStreamHeader3 {
|
|
19
|
-
sampleFrequency: number;
|
|
20
|
-
maxUsedBands: number;
|
|
21
|
-
channelCount: number;
|
|
22
|
-
msUsed: boolean;
|
|
23
|
-
audioBlockFrames: number;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Stream Header Packet
|
|
27
|
-
* Ref: http://trac.musepack.net/musepack/wiki/SV8Specification#StreamHeaderPacket
|
|
28
|
-
*/
|
|
29
|
-
interface IStreamHeader extends IStreamHeader1, IStreamHeader3 {
|
|
30
|
-
sampleCount: number;
|
|
31
|
-
beginningOfSilence: number;
|
|
32
|
-
}
|
|
33
|
-
export declare class StreamReader {
|
|
34
|
-
private tokenizer;
|
|
35
|
-
constructor(tokenizer: ITokenizer);
|
|
36
|
-
readPacketHeader(): Promise<IPacketHeader>;
|
|
37
|
-
readStreamHeader(size: number): Promise<IStreamHeader>;
|
|
38
|
-
private readVariableSizeField;
|
|
39
|
-
}
|
|
40
|
-
export {};
|
package/lib/ogg/Ogg.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Page header
|
|
3
|
-
* Ref: https://www.xiph.org/ogg/doc/framing.html#page_header
|
|
4
|
-
*/
|
|
5
|
-
export interface IPageHeader {
|
|
6
|
-
/**
|
|
7
|
-
* capture_pattern
|
|
8
|
-
* A header begins with a capture pattern that simplifies identifying pages;
|
|
9
|
-
* once the decoder has found the capture pattern it can do a more intensive job of verifying that it has in fact found a page boundary (as opposed to an inadvertent coincidence in the byte stream).
|
|
10
|
-
*/
|
|
11
|
-
capturePattern: string;
|
|
12
|
-
/**
|
|
13
|
-
* stream_structure_version
|
|
14
|
-
*/
|
|
15
|
-
version: number;
|
|
16
|
-
/**
|
|
17
|
-
* header_type_flag
|
|
18
|
-
*/
|
|
19
|
-
headerType: {
|
|
20
|
-
/**
|
|
21
|
-
* True: continued packet;
|
|
22
|
-
* False: fresh packet
|
|
23
|
-
*/
|
|
24
|
-
continued: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* True: first page of logical bitstream (bos)
|
|
27
|
-
* False: not first page of logical bitstream
|
|
28
|
-
*/
|
|
29
|
-
firstPage: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* True: last page of logical bitstream (eos)
|
|
32
|
-
* False: not last page of logical bitstream
|
|
33
|
-
*/
|
|
34
|
-
lastPage: boolean;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* The total samples encoded after including all packets finished on this page
|
|
38
|
-
* The position specified in the frame header of the last page tells how long the data coded by the bitstream is.
|
|
39
|
-
*/
|
|
40
|
-
absoluteGranulePosition: number;
|
|
41
|
-
streamSerialNumber: number;
|
|
42
|
-
pageSequenceNo: number;
|
|
43
|
-
pageChecksum: number;
|
|
44
|
-
/**
|
|
45
|
-
* The number of segment entries to appear in the segment table.
|
|
46
|
-
* The maximum number of 255 segments (255 bytes each) sets the maximum possible physical page size at 65307 bytes or
|
|
47
|
-
* just under 64kB (thus we know that a header corrupted so as destroy sizing/alignment information will not cause a
|
|
48
|
-
* runaway bitstream. We'll read in the page according to the corrupted size information that's guaranteed to be a
|
|
49
|
-
* reasonable size regardless, notice the checksum mismatch, drop sync and then look for recapture).
|
|
50
|
-
*/
|
|
51
|
-
page_segments: number;
|
|
52
|
-
}
|
|
53
|
-
export interface ISegmentTable {
|
|
54
|
-
totalPageSize: number;
|
|
55
|
-
}
|
|
56
|
-
export interface IPageConsumer {
|
|
57
|
-
/**
|
|
58
|
-
* Parse Ogg page
|
|
59
|
-
* @param {IPageHeader} header Ogg page header
|
|
60
|
-
* @param {Buffer} pageData Ogg page data
|
|
61
|
-
*/
|
|
62
|
-
parsePage(header: IPageHeader, pageData: Uint8Array): any;
|
|
63
|
-
/**
|
|
64
|
-
* Calculate duration of provided header
|
|
65
|
-
* @param header Ogg header
|
|
66
|
-
*/
|
|
67
|
-
calculateDuration(header: IPageHeader): any;
|
|
68
|
-
/**
|
|
69
|
-
* Force to parse pending segments
|
|
70
|
-
*/
|
|
71
|
-
flush(): any;
|
|
72
|
-
}
|
package/lib/ogg/OggParser.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
import { BasicParser } from '../common/BasicParser';
|
|
3
|
-
import * as Ogg from './Ogg';
|
|
4
|
-
export declare class SegmentTable implements IGetToken<Ogg.ISegmentTable> {
|
|
5
|
-
private static sum;
|
|
6
|
-
len: number;
|
|
7
|
-
constructor(header: Ogg.IPageHeader);
|
|
8
|
-
get(buf: any, off: any): Ogg.ISegmentTable;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Parser for Ogg logical bitstream framing
|
|
12
|
-
*/
|
|
13
|
-
export declare class OggParser extends BasicParser {
|
|
14
|
-
private static Header;
|
|
15
|
-
private header;
|
|
16
|
-
private pageNumber;
|
|
17
|
-
private pageConsumer;
|
|
18
|
-
/**
|
|
19
|
-
* Parse page
|
|
20
|
-
* @returns {Promise<void>}
|
|
21
|
-
*/
|
|
22
|
-
parse(): Promise<void>;
|
|
23
|
-
}
|
package/lib/ogg/opus/Opus.d.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
/**
|
|
3
|
-
* Opus ID Header interface
|
|
4
|
-
* Ref: https://wiki.xiph.org/OggOpus#ID_Header
|
|
5
|
-
*/
|
|
6
|
-
export interface IIdHeader {
|
|
7
|
-
/**
|
|
8
|
-
* Magic signature: "OpusHead" (64 bits)
|
|
9
|
-
*/
|
|
10
|
-
magicSignature: string;
|
|
11
|
-
/**
|
|
12
|
-
* Version number (8 bits unsigned): 0x01 for this spec
|
|
13
|
-
*/
|
|
14
|
-
version: number;
|
|
15
|
-
/**
|
|
16
|
-
* Channel count 'c' (8 bits unsigned): MUST be > 0
|
|
17
|
-
*/
|
|
18
|
-
channelCount: number;
|
|
19
|
-
/**
|
|
20
|
-
* Pre-skip (16 bits unsigned, little endian)
|
|
21
|
-
*/
|
|
22
|
-
preSkip: number;
|
|
23
|
-
/**
|
|
24
|
-
* Input sample rate (32 bits unsigned, little endian): informational only
|
|
25
|
-
*/
|
|
26
|
-
inputSampleRate: number;
|
|
27
|
-
/**
|
|
28
|
-
* Output gain (16 bits, little endian, signed Q7.8 in dB) to apply when decoding
|
|
29
|
-
*/
|
|
30
|
-
outputGain: number;
|
|
31
|
-
/**
|
|
32
|
-
* Channel mapping family (8 bits unsigned)
|
|
33
|
-
* - 0 = one stream: mono or L,R stereo
|
|
34
|
-
* - 1 = channels in vorbis spec order: mono or L,R stereo or ... or FL,C,FR,RL,RR,LFE, ...
|
|
35
|
-
* - 2..254 = reserved (treat as 255)
|
|
36
|
-
* - 255 = no defined channel meaning
|
|
37
|
-
*/
|
|
38
|
-
channelMapping: number;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Opus ID Header parser
|
|
42
|
-
* Ref: https://wiki.xiph.org/OggOpus#ID_Header
|
|
43
|
-
*/
|
|
44
|
-
export declare class IdHeader implements IGetToken<IIdHeader> {
|
|
45
|
-
len: number;
|
|
46
|
-
constructor(len: number);
|
|
47
|
-
get(buf: any, off: any): IIdHeader;
|
|
48
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ITokenizer } from 'strtok3/lib/core';
|
|
3
|
-
import { IPageHeader } from '../Ogg';
|
|
4
|
-
import { VorbisParser } from '../vorbis/VorbisParser';
|
|
5
|
-
import { IOptions } from '../../type';
|
|
6
|
-
import { INativeMetadataCollector } from '../../common/MetadataCollector';
|
|
7
|
-
/**
|
|
8
|
-
* Opus parser
|
|
9
|
-
* Internet Engineering Task Force (IETF) - RFC 6716
|
|
10
|
-
* Used by OggParser
|
|
11
|
-
*/
|
|
12
|
-
export declare class OpusParser extends VorbisParser {
|
|
13
|
-
private tokenizer;
|
|
14
|
-
private idHeader;
|
|
15
|
-
private lastPos;
|
|
16
|
-
constructor(metadata: INativeMetadataCollector, options: IOptions, tokenizer: ITokenizer);
|
|
17
|
-
/**
|
|
18
|
-
* Parse first Opus Ogg page
|
|
19
|
-
* @param {IPageHeader} header
|
|
20
|
-
* @param {Buffer} pageData
|
|
21
|
-
*/
|
|
22
|
-
protected parseFirstPage(header: IPageHeader, pageData: Buffer): void;
|
|
23
|
-
protected parseFullPage(pageData: Buffer): void;
|
|
24
|
-
calculateDuration(header: IPageHeader): void;
|
|
25
|
-
}
|
package/lib/ogg/speex/Speex.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
/**
|
|
3
|
-
* Speex Header Packet
|
|
4
|
-
* Ref: https://www.speex.org/docs/manual/speex-manual/node8.html#SECTION00830000000000000000
|
|
5
|
-
*/
|
|
6
|
-
export interface IHeader {
|
|
7
|
-
/**
|
|
8
|
-
* speex_string, char[] 8
|
|
9
|
-
*/
|
|
10
|
-
speex: string;
|
|
11
|
-
/**
|
|
12
|
-
* speex_version, char[] 20
|
|
13
|
-
*/
|
|
14
|
-
version: string;
|
|
15
|
-
/**
|
|
16
|
-
* Version id
|
|
17
|
-
*/
|
|
18
|
-
version_id: number;
|
|
19
|
-
header_size: number;
|
|
20
|
-
rate: number;
|
|
21
|
-
mode: number;
|
|
22
|
-
mode_bitstream_version: number;
|
|
23
|
-
nb_channels: number;
|
|
24
|
-
bitrate: number;
|
|
25
|
-
frame_size: number;
|
|
26
|
-
vbr: number;
|
|
27
|
-
frames_per_packet: number;
|
|
28
|
-
extra_headers: number;
|
|
29
|
-
reserved1: number;
|
|
30
|
-
reserved2: number;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Speex Header Packet
|
|
34
|
-
* Ref: https://www.speex.org/docs/manual/speex-manual/node8.html#SECTION00830000000000000000
|
|
35
|
-
*/
|
|
36
|
-
export declare const Header: IGetToken<IHeader>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ITokenizer } from 'strtok3/lib/core';
|
|
3
|
-
import { IPageHeader } from '../Ogg';
|
|
4
|
-
import { VorbisParser } from '../vorbis/VorbisParser';
|
|
5
|
-
import { IOptions } from '../../type';
|
|
6
|
-
import { INativeMetadataCollector } from '../../common/MetadataCollector';
|
|
7
|
-
/**
|
|
8
|
-
* Speex, RFC 5574
|
|
9
|
-
* Ref:
|
|
10
|
-
* - https://www.speex.org/docs/manual/speex-manual/
|
|
11
|
-
* - https://tools.ietf.org/html/rfc5574
|
|
12
|
-
*/
|
|
13
|
-
export declare class SpeexParser extends VorbisParser {
|
|
14
|
-
private tokenizer;
|
|
15
|
-
constructor(metadata: INativeMetadataCollector, options: IOptions, tokenizer: ITokenizer);
|
|
16
|
-
/**
|
|
17
|
-
* Parse first Speex Ogg page
|
|
18
|
-
* @param {IPageHeader} header
|
|
19
|
-
* @param {Buffer} pageData
|
|
20
|
-
*/
|
|
21
|
-
protected parseFirstPage(header: IPageHeader, pageData: Buffer): void;
|
|
22
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
/**
|
|
3
|
-
* 6.2 Identification Header
|
|
4
|
-
* Ref: https://theora.org/doc/Theora.pdf: 6.2 Identification Header Decode
|
|
5
|
-
*/
|
|
6
|
-
export interface IIdentificationHeader {
|
|
7
|
-
id: string;
|
|
8
|
-
vmaj: number;
|
|
9
|
-
vmin: number;
|
|
10
|
-
vrev: number;
|
|
11
|
-
vmbw: number;
|
|
12
|
-
vmbh: number;
|
|
13
|
-
nombr: number;
|
|
14
|
-
nqual: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* 6.2 Identification Header
|
|
18
|
-
* Ref: https://theora.org/doc/Theora.pdf: 6.2 Identification Header Decode
|
|
19
|
-
*/
|
|
20
|
-
export declare const IdentificationHeader: IGetToken<IIdentificationHeader>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { ITokenizer } from 'strtok3/lib/core';
|
|
3
|
-
import { IOptions } from '../../type';
|
|
4
|
-
import { INativeMetadataCollector } from '../../common/MetadataCollector';
|
|
5
|
-
import * as Ogg from '../Ogg';
|
|
6
|
-
/**
|
|
7
|
-
* Ref:
|
|
8
|
-
* - https://theora.org/doc/Theora.pdf
|
|
9
|
-
*/
|
|
10
|
-
export declare class TheoraParser implements Ogg.IPageConsumer {
|
|
11
|
-
private metadata;
|
|
12
|
-
private tokenizer;
|
|
13
|
-
constructor(metadata: INativeMetadataCollector, options: IOptions, tokenizer: ITokenizer);
|
|
14
|
-
/**
|
|
15
|
-
* Vorbis 1 parser
|
|
16
|
-
* @param header Ogg Page Header
|
|
17
|
-
* @param pageData Page data
|
|
18
|
-
*/
|
|
19
|
-
parsePage(header: Ogg.IPageHeader, pageData: Buffer): void;
|
|
20
|
-
flush(): void;
|
|
21
|
-
calculateDuration(header: Ogg.IPageHeader): void;
|
|
22
|
-
/**
|
|
23
|
-
* Parse first Theora Ogg page. the initial identification header packet
|
|
24
|
-
* @param {IPageHeader} header
|
|
25
|
-
* @param {Buffer} pageData
|
|
26
|
-
*/
|
|
27
|
-
protected parseFirstPage(header: Ogg.IPageHeader, pageData: Buffer): void;
|
|
28
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
3
|
-
import { IPicture } from '../../type';
|
|
4
|
-
/**
|
|
5
|
-
* Interface to parsed result of METADATA_BLOCK_PICTURE
|
|
6
|
-
* Ref: https://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE
|
|
7
|
-
* Ref: https://xiph.org/flac/format.html#metadata_block_picture
|
|
8
|
-
*/
|
|
9
|
-
export interface IVorbisPicture extends IPicture {
|
|
10
|
-
type: string;
|
|
11
|
-
description: string;
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
colour_depth: number;
|
|
15
|
-
indexed_color: number;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Parse the METADATA_BLOCK_PICTURE
|
|
19
|
-
* Ref: https://wiki.xiph.org/VorbisComment#METADATA_BLOCK_PICTURE
|
|
20
|
-
* Ref: https://xiph.org/flac/format.html#metadata_block_picture
|
|
21
|
-
* // ToDo: move to ID3 / APIC?
|
|
22
|
-
*/
|
|
23
|
-
export declare class VorbisPictureToken implements IGetToken<IVorbisPicture> {
|
|
24
|
-
len: any;
|
|
25
|
-
static fromBase64(base64str: string): IVorbisPicture;
|
|
26
|
-
static fromBuffer(buffer: Buffer): IVorbisPicture;
|
|
27
|
-
constructor(len: any);
|
|
28
|
-
get(buffer: Buffer, offset: number): IVorbisPicture;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Vorbis 1 decoding tokens
|
|
32
|
-
* Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-620004.2.1
|
|
33
|
-
*/
|
|
34
|
-
/**
|
|
35
|
-
* Comment header interface
|
|
36
|
-
* Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-620004.2.1
|
|
37
|
-
*/
|
|
38
|
-
export interface ICommonHeader {
|
|
39
|
-
/**
|
|
40
|
-
* Packet Type
|
|
41
|
-
*/
|
|
42
|
-
packetType: number;
|
|
43
|
-
/**
|
|
44
|
-
* Should be 'vorbis'
|
|
45
|
-
*/
|
|
46
|
-
vorbis: string;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Comment header decoder
|
|
50
|
-
* Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-620004.2.1
|
|
51
|
-
*/
|
|
52
|
-
export declare const CommonHeader: IGetToken<ICommonHeader>;
|
|
53
|
-
/**
|
|
54
|
-
* Identification header interface
|
|
55
|
-
* Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-630004.2.2
|
|
56
|
-
*/
|
|
57
|
-
export interface IFormatInfo {
|
|
58
|
-
version: number;
|
|
59
|
-
channelMode: number;
|
|
60
|
-
sampleRate: number;
|
|
61
|
-
bitrateMax: number;
|
|
62
|
-
bitrateNominal: number;
|
|
63
|
-
bitrateMin: number;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Identification header decoder
|
|
67
|
-
* Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-630004.2.2
|
|
68
|
-
*/
|
|
69
|
-
export declare const IdentificationHeader: IGetToken<IFormatInfo>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class VorbisDecoder {
|
|
2
|
-
private readonly data;
|
|
3
|
-
private offset;
|
|
4
|
-
constructor(data: Uint8Array, offset: any);
|
|
5
|
-
readInt32(): number;
|
|
6
|
-
readStringUtf8(): string;
|
|
7
|
-
parseUserComment(): {
|
|
8
|
-
key: string;
|
|
9
|
-
value: string;
|
|
10
|
-
len: number;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { IOptions } from '../../type';
|
|
3
|
-
import { INativeMetadataCollector } from '../../common/MetadataCollector';
|
|
4
|
-
import * as Ogg from '../Ogg';
|
|
5
|
-
import { IVorbisPicture } from './Vorbis';
|
|
6
|
-
/**
|
|
7
|
-
* Vorbis 1 Parser.
|
|
8
|
-
* Used by OggParser
|
|
9
|
-
*/
|
|
10
|
-
export declare class VorbisParser implements Ogg.IPageConsumer {
|
|
11
|
-
protected metadata: INativeMetadataCollector;
|
|
12
|
-
protected options: IOptions;
|
|
13
|
-
private pageSegments;
|
|
14
|
-
constructor(metadata: INativeMetadataCollector, options: IOptions);
|
|
15
|
-
/**
|
|
16
|
-
* Vorbis 1 parser
|
|
17
|
-
* @param header Ogg Page Header
|
|
18
|
-
* @param pageData Page data
|
|
19
|
-
*/
|
|
20
|
-
parsePage(header: Ogg.IPageHeader, pageData: Buffer): void;
|
|
21
|
-
flush(): void;
|
|
22
|
-
parseUserComment(pageData: Buffer, offset: number): number;
|
|
23
|
-
addTag(id: string, value: string | IVorbisPicture): void;
|
|
24
|
-
calculateDuration(header: Ogg.IPageHeader): void;
|
|
25
|
-
/**
|
|
26
|
-
* Parse first Ogg/Vorbis page
|
|
27
|
-
* @param {IPageHeader} header
|
|
28
|
-
* @param {Buffer} pageData
|
|
29
|
-
*/
|
|
30
|
-
protected parseFirstPage(header: Ogg.IPageHeader, pageData: Buffer): void;
|
|
31
|
-
protected parseFullPage(pageData: Buffer): void;
|
|
32
|
-
/**
|
|
33
|
-
* Ref: https://xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-840005.2
|
|
34
|
-
*/
|
|
35
|
-
protected parseUserCommentList(pageData: Buffer, offset: number): void;
|
|
36
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CommonTagMapper } from '../../common/GenericTagMapper';
|
|
2
|
-
import { IRating, ITag } from '../../type';
|
|
3
|
-
export declare class VorbisTagMapper extends CommonTagMapper {
|
|
4
|
-
static toRating(email: string, rating: string): IRating;
|
|
5
|
-
constructor();
|
|
6
|
-
protected postMap(tag: ITag): void;
|
|
7
|
-
}
|
package/lib/riff/RiffChunk.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IGetToken } from 'strtok3/lib/core';
|
|
2
|
-
import { IChunkHeader } from '../iff';
|
|
3
|
-
export { IChunkHeader } from '../iff';
|
|
4
|
-
/**
|
|
5
|
-
* Common RIFF chunk header
|
|
6
|
-
*/
|
|
7
|
-
export declare const Header: IGetToken<IChunkHeader>;
|
|
8
|
-
/**
|
|
9
|
-
* Token to parse RIFF-INFO tag value
|
|
10
|
-
*/
|
|
11
|
-
export declare class ListInfoTagValue implements IGetToken<string> {
|
|
12
|
-
private tagHeader;
|
|
13
|
-
len: number;
|
|
14
|
-
constructor(tagHeader: IChunkHeader);
|
|
15
|
-
get(buf: any, off: any): string;
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { INativeTagMap } from '../common/GenericTagTypes';
|
|
2
|
-
import { CommonTagMapper } from '../common/GenericTagMapper';
|
|
3
|
-
/**
|
|
4
|
-
* RIFF Info Tags; part of the EXIF 2.3
|
|
5
|
-
* Ref: http://owl.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html#Info
|
|
6
|
-
*/
|
|
7
|
-
export declare const riffInfoTagMap: INativeTagMap;
|
|
8
|
-
export declare class RiffInfoTagMapper extends CommonTagMapper {
|
|
9
|
-
constructor();
|
|
10
|
-
}
|