@probityrules/jsmediatags 4.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.
Files changed (53) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/LICENSE.md +36 -0
  3. package/README.md +548 -0
  4. package/build/ArrayBufferFileReader.d.ts +12 -0
  5. package/build/ArrayBufferFileReader.js +27 -0
  6. package/build/ArrayFileReader.d.ts +11 -0
  7. package/build/ArrayFileReader.js +30 -0
  8. package/build/BlobFileReader.d.ts +12 -0
  9. package/build/BlobFileReader.js +47 -0
  10. package/build/ByteArrayUtils.d.ts +9 -0
  11. package/build/ByteArrayUtils.js +46 -0
  12. package/build/ChunkedFileData.d.ts +28 -0
  13. package/build/ChunkedFileData.js +171 -0
  14. package/build/DecodedString.d.ts +6 -0
  15. package/build/DecodedString.js +2 -0
  16. package/build/FLACTagContents.d.ts +19 -0
  17. package/build/FLACTagContents.js +54 -0
  18. package/build/FLACTagReader.d.ts +103 -0
  19. package/build/FLACTagReader.js +320 -0
  20. package/build/ID3v1TagReader.d.ts +10 -0
  21. package/build/ID3v1TagReader.js +176 -0
  22. package/build/ID3v2FrameReader.d.ts +25 -0
  23. package/build/ID3v2FrameReader.js +582 -0
  24. package/build/ID3v2TagContents.d.ts +82 -0
  25. package/build/ID3v2TagContents.js +318 -0
  26. package/build/ID3v2TagReader.d.ts +13 -0
  27. package/build/ID3v2TagReader.js +118 -0
  28. package/build/MP4TagContents.d.ts +17 -0
  29. package/build/MP4TagContents.js +52 -0
  30. package/build/MP4TagReader.d.ts +19 -0
  31. package/build/MP4TagReader.js +291 -0
  32. package/build/MediaFileReader.d.ts +46 -0
  33. package/build/MediaFileReader.js +168 -0
  34. package/build/MediaTagReader.d.ts +18 -0
  35. package/build/MediaTagReader.js +76 -0
  36. package/build/NodeFileReader.d.ts +12 -0
  37. package/build/NodeFileReader.js +103 -0
  38. package/build/ReactNativeFileReader.d.ts +12 -0
  39. package/build/ReactNativeFileReader.js +48 -0
  40. package/build/StringUtils.d.ts +7 -0
  41. package/build/StringUtils.js +102 -0
  42. package/build/XhrFileReader.d.ts +41 -0
  43. package/build/XhrFileReader.js +238 -0
  44. package/build/jsmediatags.d.ts +45 -0
  45. package/build/jsmediatags.js +219 -0
  46. package/build/registerNodeFileReaders.d.ts +5 -0
  47. package/build/registerNodeFileReaders.js +19 -0
  48. package/build/registerNodeFileReaders.noop.d.ts +2 -0
  49. package/build/registerNodeFileReaders.noop.js +3 -0
  50. package/build/types.d.ts +77 -0
  51. package/build/types.js +2 -0
  52. package/dist/jsmediatags.min.js +2 -0
  53. package/package.json +110 -0
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ const MediaFileReader = require("./MediaFileReader");
3
+ class ArrayFileReader extends MediaFileReader {
4
+ constructor(array) {
5
+ super();
6
+ this._array = array;
7
+ this._size = array.length;
8
+ this._isInitialized = true;
9
+ }
10
+ static canReadFile(file) {
11
+ return (Array.isArray(file) ||
12
+ (typeof Buffer === "function" &&
13
+ typeof Buffer.isBuffer === "function" &&
14
+ Buffer.isBuffer(file)));
15
+ }
16
+ init(callbacks) {
17
+ setTimeout(callbacks.onSuccess, 0);
18
+ }
19
+ loadRange(range, callbacks) {
20
+ void range;
21
+ setTimeout(callbacks.onSuccess, 0);
22
+ }
23
+ getByteAt(offset) {
24
+ if (offset >= this._array.length) {
25
+ throw new Error("Offset " + offset + " hasn't been loaded yet.");
26
+ }
27
+ return this._array[offset];
28
+ }
29
+ }
30
+ module.exports = ArrayFileReader;
@@ -0,0 +1,12 @@
1
+ declare const MediaFileReader: any;
2
+ import type { LoadCallbackType } from "./types";
3
+ declare class BlobFileReader extends MediaFileReader {
4
+ private _blob;
5
+ private _fileData;
6
+ constructor(blob: Blob);
7
+ static canReadFile(file: unknown): boolean;
8
+ _init(callbacks: LoadCallbackType): void;
9
+ loadRange(range: [number, number], callbacks: LoadCallbackType): void;
10
+ getByteAt(offset: number): number;
11
+ }
12
+ export = BlobFileReader;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ const ChunkedFileData = require("./ChunkedFileData");
3
+ const MediaFileReader = require("./MediaFileReader");
4
+ class BlobFileReader extends MediaFileReader {
5
+ constructor(blob) {
6
+ super();
7
+ this._blob = blob;
8
+ this._fileData = new ChunkedFileData();
9
+ }
10
+ static canReadFile(file) {
11
+ return ((typeof Blob !== "undefined" && file instanceof Blob) ||
12
+ (typeof File !== "undefined" && file instanceof File));
13
+ }
14
+ _init(callbacks) {
15
+ this._size = this._blob.size;
16
+ setTimeout(callbacks.onSuccess, 1);
17
+ }
18
+ loadRange(range, callbacks) {
19
+ const self = this;
20
+ const blobSlice = this._blob.slice ||
21
+ this._blob.mozSlice ||
22
+ this._blob.webkitSlice;
23
+ const blob = blobSlice.call(this._blob, range[0], range[1] + 1);
24
+ const browserFileReader = new FileReader();
25
+ browserFileReader.onloadend = function () {
26
+ const result = browserFileReader.result;
27
+ const intArray = new Uint8Array(result);
28
+ self._fileData.addData(range[0], intArray);
29
+ callbacks.onSuccess();
30
+ };
31
+ browserFileReader.onerror =
32
+ browserFileReader.onabort =
33
+ function () {
34
+ if (callbacks.onError) {
35
+ callbacks.onError({
36
+ type: "blob",
37
+ info: browserFileReader.error,
38
+ });
39
+ }
40
+ };
41
+ browserFileReader.readAsArrayBuffer(blob);
42
+ }
43
+ getByteAt(offset) {
44
+ return this._fileData.getByteAt(offset);
45
+ }
46
+ }
47
+ module.exports = BlobFileReader;
@@ -0,0 +1,9 @@
1
+ import type { ByteArray } from "./types";
2
+ declare const _default: {
3
+ bin: (string: string) => ByteArray;
4
+ pad: (array: Array<number>, size: number) => Array<number>;
5
+ getSynchsafeInteger32: (number: number) => ByteArray;
6
+ getInteger32: (number: number) => ByteArray;
7
+ getInteger24: (number: number) => ByteArray;
8
+ };
9
+ export = _default;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ /**
3
+ * Converts a string to a binary array
4
+ */
5
+ const bin = function (string) {
6
+ const binaryArray = new Array(string.length);
7
+ for (let i = 0; i < string.length; i++) {
8
+ binaryArray[i] = string.charCodeAt(i);
9
+ }
10
+ return binaryArray;
11
+ };
12
+ /**
13
+ * Pads an array with \0 until it is size length.
14
+ */
15
+ const pad = function (array, size) {
16
+ for (let i = array.length; i < size; i++) {
17
+ array.push(0);
18
+ }
19
+ return array;
20
+ };
21
+ const getSynchsafeInteger32 = function (number) {
22
+ return [
23
+ (number >> 21) & 0x7f,
24
+ (number >> 14) & 0x7f,
25
+ (number >> 7) & 0x7f,
26
+ number & 0x7f,
27
+ ];
28
+ };
29
+ const getInteger32 = function (number) {
30
+ return [
31
+ (number >> 24) & 0xff,
32
+ (number >> 16) & 0xff,
33
+ (number >> 8) & 0xff,
34
+ number & 0xff,
35
+ ];
36
+ };
37
+ const getInteger24 = function (number) {
38
+ return [(number >> 16) & 0xff, (number >> 8) & 0xff, number & 0xff];
39
+ };
40
+ module.exports = {
41
+ bin: bin,
42
+ pad: pad,
43
+ getSynchsafeInteger32: getSynchsafeInteger32,
44
+ getInteger32: getInteger32,
45
+ getInteger24: getInteger24,
46
+ };
@@ -0,0 +1,28 @@
1
+ import type { DataType } from "./types";
2
+ declare class ChunkedFileData {
3
+ static get NOT_FOUND(): number;
4
+ private _fileData;
5
+ constructor();
6
+ /**
7
+ * Adds data to the file storage at a specific offset.
8
+ */
9
+ addData(offset: number, data: DataType): void;
10
+ _concatData(dataA: DataType, dataB: DataType): DataType;
11
+ _sliceData(data: DataType, begin: number, end: number): DataType;
12
+ /**
13
+ * Finds the chunk range that overlaps the [offsetStart-1,offsetEnd+1] range.
14
+ * When a chunk is adjacent to the offset we still consider it part of the
15
+ * range (this is the situation of offsetStart-1 or offsetEnd+1).
16
+ * When no chunks are found `insertIx` denotes the index where the data
17
+ * should be inserted in the data list (startIx == NOT_FOUND and endIX ==
18
+ * NOT_FOUND).
19
+ */
20
+ _getChunkRange(offsetStart: number, offsetEnd: number): {
21
+ startIx: number;
22
+ endIx: number;
23
+ insertIx?: number;
24
+ };
25
+ hasDataRange(offsetStart: number, offsetEnd: number): boolean;
26
+ getByteAt(offset: number): number;
27
+ }
28
+ export = ChunkedFileData;
@@ -0,0 +1,171 @@
1
+ /**
2
+ * This class represents a file that might not have all its data loaded yet.
3
+ * It is used when loading the entire file is not an option because it's too
4
+ * expensive. Instead, parts of the file are loaded and added only when needed.
5
+ * From a reading point of view is as if the entire file is loaded. The
6
+ * exception is when the data is not available yet, an error will be thrown.
7
+ * This class does not load the data, it just manages it. It provides operations
8
+ * to add and read data from the file.
9
+ */
10
+ "use strict";
11
+ const NOT_FOUND = -1;
12
+ function dataLength(data) {
13
+ return data.length;
14
+ }
15
+ function isUint8(data) {
16
+ return data instanceof Uint8Array;
17
+ }
18
+ class ChunkedFileData {
19
+ static get NOT_FOUND() {
20
+ return NOT_FOUND;
21
+ }
22
+ constructor() {
23
+ this._fileData = [];
24
+ }
25
+ /**
26
+ * Adds data to the file storage at a specific offset.
27
+ */
28
+ addData(offset, data) {
29
+ const offsetEnd = offset + dataLength(data) - 1;
30
+ const chunkRange = this._getChunkRange(offset, offsetEnd);
31
+ if (chunkRange.startIx === NOT_FOUND) {
32
+ this._fileData.splice(chunkRange.insertIx || 0, 0, {
33
+ offset: offset,
34
+ data: data,
35
+ });
36
+ }
37
+ else {
38
+ const firstChunk = this._fileData[chunkRange.startIx];
39
+ const lastChunk = this._fileData[chunkRange.endIx];
40
+ const needsPrepend = offset > firstChunk.offset;
41
+ const needsAppend = offsetEnd < lastChunk.offset + dataLength(lastChunk.data) - 1;
42
+ let chunk = {
43
+ offset: Math.min(offset, firstChunk.offset),
44
+ data: data,
45
+ };
46
+ if (needsPrepend) {
47
+ const slicedData = this._sliceData(firstChunk.data, 0, offset - firstChunk.offset);
48
+ chunk.data = this._concatData(slicedData, data);
49
+ }
50
+ if (needsAppend) {
51
+ const slicedData = this._sliceData(chunk.data, 0, lastChunk.offset - chunk.offset);
52
+ chunk.data = this._concatData(slicedData, lastChunk.data);
53
+ }
54
+ this._fileData.splice(chunkRange.startIx, chunkRange.endIx - chunkRange.startIx + 1, chunk);
55
+ }
56
+ }
57
+ _concatData(dataA, dataB) {
58
+ if (isUint8(dataA) && isUint8(dataB)) {
59
+ const Ctor = dataA.constructor;
60
+ const dataAandB = new Ctor(dataA.length + dataB.length);
61
+ dataAandB.set(dataA, 0);
62
+ dataAandB.set(dataB, dataA.length);
63
+ return dataAandB;
64
+ }
65
+ if (Array.isArray(dataA) && Array.isArray(dataB)) {
66
+ return dataA.concat(dataB);
67
+ }
68
+ const sA = typeof dataA === "string" ? dataA : "";
69
+ const sB = typeof dataB === "string" ? dataB : "";
70
+ return sA + sB;
71
+ }
72
+ _sliceData(data, begin, end) {
73
+ if (typeof data === "string") {
74
+ return data.slice(begin, end);
75
+ }
76
+ if (Array.isArray(data)) {
77
+ return data.slice(begin, end);
78
+ }
79
+ const view = data;
80
+ if (typeof view.subarray === "function") {
81
+ return view.subarray(begin, end);
82
+ }
83
+ return view.slice(begin, end);
84
+ }
85
+ /**
86
+ * Finds the chunk range that overlaps the [offsetStart-1,offsetEnd+1] range.
87
+ * When a chunk is adjacent to the offset we still consider it part of the
88
+ * range (this is the situation of offsetStart-1 or offsetEnd+1).
89
+ * When no chunks are found `insertIx` denotes the index where the data
90
+ * should be inserted in the data list (startIx == NOT_FOUND and endIX ==
91
+ * NOT_FOUND).
92
+ */
93
+ _getChunkRange(offsetStart, offsetEnd) {
94
+ let startChunkIx = NOT_FOUND;
95
+ let endChunkIx = NOT_FOUND;
96
+ let insertIx = 0;
97
+ for (let i = 0; i < this._fileData.length; i++, insertIx = i) {
98
+ const chunkOffsetStart = this._fileData[i].offset;
99
+ const chunkOffsetEnd = chunkOffsetStart + dataLength(this._fileData[i].data);
100
+ if (offsetEnd < chunkOffsetStart - 1) {
101
+ break;
102
+ }
103
+ if (offsetStart <= chunkOffsetEnd + 1 &&
104
+ offsetEnd >= chunkOffsetStart - 1) {
105
+ startChunkIx = i;
106
+ break;
107
+ }
108
+ }
109
+ if (startChunkIx === NOT_FOUND) {
110
+ return {
111
+ startIx: NOT_FOUND,
112
+ endIx: NOT_FOUND,
113
+ insertIx: insertIx,
114
+ };
115
+ }
116
+ for (let i = startChunkIx; i < this._fileData.length; i++) {
117
+ const chunkOffsetStart = this._fileData[i].offset;
118
+ const chunkOffsetEnd = chunkOffsetStart + dataLength(this._fileData[i].data);
119
+ if (offsetEnd >= chunkOffsetStart - 1) {
120
+ endChunkIx = i;
121
+ }
122
+ if (offsetEnd <= chunkOffsetEnd + 1) {
123
+ break;
124
+ }
125
+ }
126
+ if (endChunkIx === NOT_FOUND) {
127
+ endChunkIx = startChunkIx;
128
+ }
129
+ return {
130
+ startIx: startChunkIx,
131
+ endIx: endChunkIx,
132
+ };
133
+ }
134
+ hasDataRange(offsetStart, offsetEnd) {
135
+ for (let i = 0; i < this._fileData.length; i++) {
136
+ const chunk = this._fileData[i];
137
+ if (offsetEnd < chunk.offset) {
138
+ return false;
139
+ }
140
+ if (offsetStart >= chunk.offset &&
141
+ offsetEnd < chunk.offset + dataLength(chunk.data)) {
142
+ return true;
143
+ }
144
+ }
145
+ return false;
146
+ }
147
+ getByteAt(offset) {
148
+ let dataChunk;
149
+ for (let i = 0; i < this._fileData.length; i++) {
150
+ const dataChunkStart = this._fileData[i].offset;
151
+ const dataChunkEnd = dataChunkStart + dataLength(this._fileData[i].data) - 1;
152
+ if (offset >= dataChunkStart && offset <= dataChunkEnd) {
153
+ dataChunk = this._fileData[i];
154
+ break;
155
+ }
156
+ }
157
+ if (dataChunk) {
158
+ const idx = offset - dataChunk.offset;
159
+ const d = dataChunk.data;
160
+ if (typeof d === "string") {
161
+ return d.charCodeAt(idx) & 0xff;
162
+ }
163
+ if (Array.isArray(d)) {
164
+ return d[idx];
165
+ }
166
+ return d[idx];
167
+ }
168
+ throw new Error("Offset " + offset + " hasn't been loaded yet.");
169
+ }
170
+ }
171
+ module.exports = ChunkedFileData;
@@ -0,0 +1,6 @@
1
+ /** Return type of StringUtils decoded-string readers */
2
+ export interface DecodedString {
3
+ bytesReadCount: number;
4
+ length: number;
5
+ toString(): string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,19 @@
1
+ import type { ByteArray } from './types';
2
+ declare class FLACTagContents {
3
+ _blocks: Array<MetadataBlock>;
4
+ constructor(blocks?: Array<MetadataBlock>);
5
+ toArray(): ByteArray;
6
+ static createBlock(type: number, data: ByteArray): MetadataBlock;
7
+ static createStreamBlock(): MetadataBlock;
8
+ static createCommentBlock(...data: Array<Array<string>>): MetadataBlock;
9
+ static createPictureBlock(): MetadataBlock;
10
+ }
11
+ declare class MetadataBlock {
12
+ _data: Array<number>;
13
+ _final: boolean;
14
+ _type: number;
15
+ constructor(type: number, data: ByteArray);
16
+ setFinal(): void;
17
+ toArray(): ByteArray;
18
+ }
19
+ export = FLACTagContents;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ const bin = require('./ByteArrayUtils').bin;
3
+ const getInteger24 = require('./ByteArrayUtils').getInteger24;
4
+ const getInteger32 = require('./ByteArrayUtils').getInteger32;
5
+ class FLACTagContents {
6
+ constructor(blocks) {
7
+ this._blocks = [];
8
+ this._blocks.push(FLACTagContents.createStreamBlock());
9
+ this._blocks = this._blocks.concat(blocks || []);
10
+ }
11
+ toArray() {
12
+ this._blocks[this._blocks.length - 1].setFinal();
13
+ return this._blocks.reduce(function (array, block) {
14
+ return array.concat(block.toArray());
15
+ }, bin("fLaC"));
16
+ }
17
+ static createBlock(type, data) {
18
+ return new MetadataBlock(type, data);
19
+ }
20
+ static createStreamBlock() {
21
+ let data = [].concat([0x00, 0x00, 0x22], Array(34).fill(0x00));
22
+ return this.createBlock(0, data);
23
+ }
24
+ static createCommentBlock(...data) {
25
+ let length = 12;
26
+ let byteArray = [];
27
+ for (let i = 0; i < data.length; i++) {
28
+ length += data[i][0].length + data[i][1].length + 5;
29
+ byteArray = byteArray.concat(getInteger32(data[i][0].length + data[i][1].length + 1).reverse());
30
+ let entry = data[i][0] + "=" + data[i][1];
31
+ byteArray = byteArray.concat(bin(entry));
32
+ }
33
+ let array = [].concat(getInteger24(length), [0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], getInteger32(data.length).reverse(), byteArray);
34
+ return this.createBlock(4, array);
35
+ }
36
+ static createPictureBlock() {
37
+ let data = [].concat(getInteger24(45), getInteger32(3), getInteger32(10), bin("image/jpeg"), getInteger32(9), bin("A Picture"), Array(16).fill(0x00), getInteger32(4), bin("data"));
38
+ return this.createBlock(6, data);
39
+ }
40
+ }
41
+ class MetadataBlock {
42
+ constructor(type, data) {
43
+ this._type = type;
44
+ this._data = data;
45
+ this._final = false;
46
+ }
47
+ setFinal() {
48
+ this._final = true;
49
+ }
50
+ toArray() {
51
+ return [this._type + (this._final ? 128 : 0)].concat(this._data);
52
+ }
53
+ }
54
+ module.exports = FLACTagContents;
@@ -0,0 +1,103 @@
1
+ declare const MediaTagReader: any;
2
+ declare const MediaFileReader: any;
3
+ type MediaReader = InstanceType<typeof MediaFileReader>;
4
+ import type { LoadCallbackType, ByteRange, TagType } from './types';
5
+ /**
6
+ * Class representing a MediaTagReader that parses FLAC tags.
7
+ */
8
+ declare class FLACTagReader extends MediaTagReader {
9
+ _commentOffset?: number;
10
+ _pictureOffset?: number;
11
+ /**
12
+ * Gets the byte range for the tag identifier.
13
+ *
14
+ * Because the Vorbis comment block is not guaranteed to be in a specified
15
+ * location, we can only load the first 4 bytes of the file to confirm it
16
+ * is a FLAC first.
17
+ *
18
+ * @return {ByteRange} The byte range that identifies the tag for a FLAC.
19
+ */
20
+ static getTagIdentifierByteRange(): ByteRange;
21
+ /**
22
+ * Determines whether or not this reader can read a certain tag format.
23
+ *
24
+ * This checks that the first 4 characters in the file are fLaC, which
25
+ * according to the FLAC file specification should be the characters that
26
+ * indicate a FLAC file.
27
+ *
28
+ * @return {boolean} True if the header is fLaC, false otherwise.
29
+ */
30
+ static canReadTagFormat(tagIdentifier: Array<number>): boolean;
31
+ /**
32
+ * Function called to load the data from the file.
33
+ *
34
+ * To begin processing the blocks, the next 4 bytes after the initial 4 bytes
35
+ * (bytes 4 through 7) are loaded. From there, the rest of the loading process
36
+ * is passed on to the _loadBlock function, which will handle the rest of the
37
+ * parsing for the metadata blocks.
38
+ *
39
+ * @param {MediaFileReader} mediaFileReader - The MediaFileReader used to parse the file.
40
+ * @param {LoadCallbackType} callbacks - The callback to call once _loadData is completed.
41
+ */
42
+ _loadData(mediaFileReader: MediaReader, callbacks: LoadCallbackType): void;
43
+ /**
44
+ * Special internal function used to parse the different FLAC blocks.
45
+ *
46
+ * The FLAC specification doesn't specify a specific location for metadata to resign, but
47
+ * dictates that it may be in one of various blocks located throughout the file. To load the
48
+ * metadata, we must locate the header first. This can be done by reading the first byte of
49
+ * each block to determine the block type. After the block type comes a 24 bit integer that stores
50
+ * the length of the block as big endian. Using this, we locate the block and store the offset for
51
+ * parsing later.
52
+ *
53
+ * After each block has been parsed, the _nextBlock function is called in order
54
+ * to parse the information of the next block. All blocks need to be parsed in order to find
55
+ * all of the picture and comment blocks.
56
+ *
57
+ * More info on the FLAC specification may be found here:
58
+ * https://xiph.org/flac/format.html
59
+ * @param {MediaFileReader} mediaFileReader - The MediaFileReader used to parse the file.
60
+ * @param {number} offset - The offset to start checking the header from.
61
+ * @param {LoadCallbackType} callbacks - The callback to call once the header has been found.
62
+ */
63
+ _loadBlock(mediaFileReader: MediaReader, offset: number, callbacks: LoadCallbackType): void;
64
+ /**
65
+ * Internal function used to load the next range and respective block.
66
+ *
67
+ * If the metadata block that was identified is not the last block before the
68
+ * audio blocks, the function will continue loading the next blocks. If it is
69
+ * the last block (identified by any values greater than 127, see FLAC spec.),
70
+ * the function will determine whether a comment block had been identified.
71
+ *
72
+ * If the block does not exist, the error callback is called. Otherwise, the function
73
+ * will call the success callback, allowing data parsing to begin.
74
+ * @param {MediaFileReader} mediaFileReader - The MediaFileReader used to parse the file.
75
+ * @param {number} offset - The offset that the existing header was located at.
76
+ * @param {number} blockHeader - An integer reflecting the header type of the block.
77
+ * @param {number} blockSize - The size of the previously processed header.
78
+ * @param {LoadCallbackType} callbacks - The callback functions to be called.
79
+ */
80
+ _nextBlock(mediaFileReader: MediaReader, offset: number, blockHeader: number, blockSize: number, callbacks: LoadCallbackType): void;
81
+ /**
82
+ * Parses the data and returns the tags.
83
+ *
84
+ * This is an overview of the VorbisComment format and what this function attempts to
85
+ * retrieve:
86
+ * - First 4 bytes: a long that contains the length of the vendor string.
87
+ * - Next n bytes: the vendor string encoded in UTF-8.
88
+ * - Next 4 bytes: a long representing how many comments are in this block
89
+ * For each comment that exists:
90
+ * - First 4 bytes: a long representing the length of the comment
91
+ * - Next n bytes: the comment encoded in UTF-8.
92
+ * The comment string will usually appear in a format similar to:
93
+ * ARTIST=me
94
+ *
95
+ * Note that the longs and integers in this block are encoded in little endian
96
+ * as opposed to big endian for the rest of the FLAC spec.
97
+ * @param {MediaFileReader} data - The MediaFileReader to parse the file with.
98
+ * @param {Array<string>} [tags] - Optional tags to also be retrieved from the file.
99
+ * @return {TagType} - An object containing the tag information for the file.
100
+ */
101
+ _parseData(data: MediaReader, _tags: Array<string> | null): TagType;
102
+ }
103
+ export = FLACTagReader;