agdi 3.3.6 → 3.3.8

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 (36) hide show
  1. package/README.md +13 -0
  2. package/dist/APEv2Parser-EU45AV6X.js +14 -0
  3. package/dist/AiffParser-FOX7GQ42.js +189 -0
  4. package/dist/AsfParser-HD5CSGIO.js +610 -0
  5. package/dist/DsdiffParser-OJREDMBI.js +188 -0
  6. package/dist/DsfParser-2YL4ARJ7.js +110 -0
  7. package/dist/FlacParser-IVV4RYF6.js +15 -0
  8. package/dist/MP4Parser-NLX4A2YN.js +1140 -0
  9. package/dist/MatroskaParser-4OEK43GF.js +654 -0
  10. package/dist/MpegParser-PXKEUF2B.js +642 -0
  11. package/dist/MusepackParser-54QGYRLY.js +322 -0
  12. package/dist/OggParser-KRV5QCGZ.js +435 -0
  13. package/dist/WavPackParser-XPZSQFVS.js +203 -0
  14. package/dist/WaveParser-27IS2RAI.js +294 -0
  15. package/dist/chunk-2B4QMSZW.js +311 -0
  16. package/dist/chunk-3JKZUGPJ.js +70 -0
  17. package/dist/chunk-4VNS5WPM.js +42 -0
  18. package/dist/chunk-65JVFJ3X.js +729 -0
  19. package/dist/chunk-6OKLAJRQ.js +0 -0
  20. package/dist/chunk-AGSFUVRG.js +439 -0
  21. package/dist/chunk-GD35BJSH.js +177 -0
  22. package/dist/chunk-HNLU36CC.js +702 -0
  23. package/dist/{chunk-M2FF7ETI.js → chunk-J6OLLWVT.js} +1 -1
  24. package/dist/chunk-LREP5CZP.js +146 -0
  25. package/dist/chunk-M54HVABG.js +34 -0
  26. package/dist/{chunk-S45VXJEO.js → chunk-OPFFFAQC.js} +19 -1
  27. package/dist/chunk-VGOIHW7D.js +1529 -0
  28. package/dist/chunk-YIHDW7JC.js +314 -0
  29. package/dist/config-D3QBUN2Y.js +13 -0
  30. package/dist/{config-ZFU7TSU2.js → config-K2XM6D4Z.js} +3 -2
  31. package/dist/{event-bus-Q3WCETQQ.js → event-bus-MO5SFUME.js} +1 -0
  32. package/dist/index.js +3966 -1203
  33. package/dist/lib-2XISBYT3.js +144950 -0
  34. package/dist/lib-HCGLI2GJ.js +4161 -0
  35. package/dist/{telemetry-service-OHU5NKON.js → telemetry-service-76YPOPDM.js} +8 -4
  36. package/package.json +5 -2
@@ -0,0 +1,188 @@
1
+ import {
2
+ ID3v2Parser
3
+ } from "./chunk-65JVFJ3X.js";
4
+ import "./chunk-2B4QMSZW.js";
5
+ import {
6
+ FourCcToken
7
+ } from "./chunk-YIHDW7JC.js";
8
+ import {
9
+ fromBuffer
10
+ } from "./chunk-HNLU36CC.js";
11
+ import "./chunk-LREP5CZP.js";
12
+ import "./chunk-GD35BJSH.js";
13
+ import {
14
+ BasicParser,
15
+ INT64_BE,
16
+ StringType,
17
+ UINT16_BE,
18
+ UINT32_BE,
19
+ UINT32_LE,
20
+ UINT8,
21
+ Uint8ArrayType,
22
+ makeUnexpectedFileContentError,
23
+ require_src
24
+ } from "./chunk-VGOIHW7D.js";
25
+ import {
26
+ __toESM
27
+ } from "./chunk-4VNS5WPM.js";
28
+
29
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js
30
+ var import_debug = __toESM(require_src(), 1);
31
+
32
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/dsdiff/DsdiffToken.js
33
+ var ChunkHeader64 = {
34
+ len: 12,
35
+ get: (buf, off) => {
36
+ return {
37
+ // Group-ID
38
+ chunkID: FourCcToken.get(buf, off),
39
+ // Size
40
+ chunkSize: INT64_BE.get(buf, off + 4)
41
+ };
42
+ }
43
+ };
44
+
45
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/dsdiff/DsdiffParser.js
46
+ var debug = (0, import_debug.default)("music-metadata:parser:aiff");
47
+ var DsdiffContentParseError = class extends makeUnexpectedFileContentError("DSDIFF") {
48
+ };
49
+ var DsdiffParser = class extends BasicParser {
50
+ async parse() {
51
+ const header = await this.tokenizer.readToken(ChunkHeader64);
52
+ if (header.chunkID !== "FRM8")
53
+ throw new DsdiffContentParseError("Unexpected chunk-ID");
54
+ this.metadata.setAudioOnly();
55
+ const type = (await this.tokenizer.readToken(FourCcToken)).trim();
56
+ switch (type) {
57
+ case "DSD":
58
+ this.metadata.setFormat("container", `DSDIFF/${type}`);
59
+ this.metadata.setFormat("lossless", true);
60
+ return this.readFmt8Chunks(header.chunkSize - BigInt(FourCcToken.len));
61
+ default:
62
+ throw new DsdiffContentParseError(`Unsupported DSDIFF type: ${type}`);
63
+ }
64
+ }
65
+ async readFmt8Chunks(remainingSize) {
66
+ while (remainingSize >= ChunkHeader64.len) {
67
+ const chunkHeader = await this.tokenizer.readToken(ChunkHeader64);
68
+ debug(`Chunk id=${chunkHeader.chunkID}`);
69
+ await this.readData(chunkHeader);
70
+ remainingSize -= BigInt(ChunkHeader64.len) + chunkHeader.chunkSize;
71
+ }
72
+ }
73
+ async readData(header) {
74
+ debug(`Reading data of chunk[ID=${header.chunkID}, size=${header.chunkSize}]`);
75
+ const p0 = this.tokenizer.position;
76
+ switch (header.chunkID.trim()) {
77
+ case "FVER": {
78
+ const version = await this.tokenizer.readToken(UINT32_LE);
79
+ debug(`DSDIFF version=${version}`);
80
+ break;
81
+ }
82
+ case "PROP": {
83
+ const propType = await this.tokenizer.readToken(FourCcToken);
84
+ if (propType !== "SND ")
85
+ throw new DsdiffContentParseError("Unexpected PROP-chunk ID");
86
+ await this.handleSoundPropertyChunks(header.chunkSize - BigInt(FourCcToken.len));
87
+ break;
88
+ }
89
+ case "ID3": {
90
+ const id3_data = await this.tokenizer.readToken(new Uint8ArrayType(Number(header.chunkSize)));
91
+ const rst = fromBuffer(id3_data);
92
+ await new ID3v2Parser().parse(this.metadata, rst, this.options);
93
+ break;
94
+ }
95
+ case "DSD":
96
+ if (this.metadata.format.numberOfChannels) {
97
+ this.metadata.setFormat("numberOfSamples", Number(header.chunkSize * BigInt(8) / BigInt(this.metadata.format.numberOfChannels)));
98
+ }
99
+ if (this.metadata.format.numberOfSamples && this.metadata.format.sampleRate) {
100
+ this.metadata.setFormat("duration", this.metadata.format.numberOfSamples / this.metadata.format.sampleRate);
101
+ }
102
+ break;
103
+ default:
104
+ debug(`Ignore chunk[ID=${header.chunkID}, size=${header.chunkSize}]`);
105
+ break;
106
+ }
107
+ const remaining = header.chunkSize - BigInt(this.tokenizer.position - p0);
108
+ if (remaining > 0) {
109
+ debug(`After Parsing chunk, remaining ${remaining} bytes`);
110
+ await this.tokenizer.ignore(Number(remaining));
111
+ }
112
+ }
113
+ async handleSoundPropertyChunks(remainingSize) {
114
+ debug(`Parsing sound-property-chunks, remainingSize=${remainingSize}`);
115
+ while (remainingSize > 0) {
116
+ const sndPropHeader = await this.tokenizer.readToken(ChunkHeader64);
117
+ debug(`Sound-property-chunk[ID=${sndPropHeader.chunkID}, size=${sndPropHeader.chunkSize}]`);
118
+ const p0 = this.tokenizer.position;
119
+ switch (sndPropHeader.chunkID.trim()) {
120
+ case "FS": {
121
+ const sampleRate = await this.tokenizer.readToken(UINT32_BE);
122
+ this.metadata.setFormat("sampleRate", sampleRate);
123
+ break;
124
+ }
125
+ case "CHNL": {
126
+ const numChannels = await this.tokenizer.readToken(UINT16_BE);
127
+ this.metadata.setFormat("numberOfChannels", numChannels);
128
+ await this.handleChannelChunks(sndPropHeader.chunkSize - BigInt(UINT16_BE.len));
129
+ break;
130
+ }
131
+ case "CMPR": {
132
+ const compressionIdCode = (await this.tokenizer.readToken(FourCcToken)).trim();
133
+ const count = await this.tokenizer.readToken(UINT8);
134
+ const compressionName = await this.tokenizer.readToken(new StringType(count, "ascii"));
135
+ if (compressionIdCode === "DSD") {
136
+ this.metadata.setFormat("lossless", true);
137
+ this.metadata.setFormat("bitsPerSample", 1);
138
+ }
139
+ this.metadata.setFormat("codec", `${compressionIdCode} (${compressionName})`);
140
+ break;
141
+ }
142
+ case "ABSS": {
143
+ const hours = await this.tokenizer.readToken(UINT16_BE);
144
+ const minutes = await this.tokenizer.readToken(UINT8);
145
+ const seconds = await this.tokenizer.readToken(UINT8);
146
+ const samples = await this.tokenizer.readToken(UINT32_BE);
147
+ debug(`ABSS ${hours}:${minutes}:${seconds}.${samples}`);
148
+ break;
149
+ }
150
+ case "LSCO": {
151
+ const lsConfig = await this.tokenizer.readToken(UINT16_BE);
152
+ debug(`LSCO lsConfig=${lsConfig}`);
153
+ break;
154
+ }
155
+ default:
156
+ debug(`Unknown sound-property-chunk[ID=${sndPropHeader.chunkID}, size=${sndPropHeader.chunkSize}]`);
157
+ await this.tokenizer.ignore(Number(sndPropHeader.chunkSize));
158
+ }
159
+ const remaining = sndPropHeader.chunkSize - BigInt(this.tokenizer.position - p0);
160
+ if (remaining > 0) {
161
+ debug(`After Parsing sound-property-chunk ${sndPropHeader.chunkSize}, remaining ${remaining} bytes`);
162
+ await this.tokenizer.ignore(Number(remaining));
163
+ }
164
+ remainingSize -= BigInt(ChunkHeader64.len) + sndPropHeader.chunkSize;
165
+ debug(`Parsing sound-property-chunks, remainingSize=${remainingSize}`);
166
+ }
167
+ if (this.metadata.format.lossless && this.metadata.format.sampleRate && this.metadata.format.numberOfChannels && this.metadata.format.bitsPerSample) {
168
+ const bitrate = this.metadata.format.sampleRate * this.metadata.format.numberOfChannels * this.metadata.format.bitsPerSample;
169
+ this.metadata.setFormat("bitrate", bitrate);
170
+ }
171
+ }
172
+ async handleChannelChunks(remainingSize) {
173
+ debug(`Parsing channel-chunks, remainingSize=${remainingSize}`);
174
+ const channels = [];
175
+ while (remainingSize >= FourCcToken.len) {
176
+ const channelId = await this.tokenizer.readToken(FourCcToken);
177
+ debug(`Channel[ID=${channelId}]`);
178
+ channels.push(channelId);
179
+ remainingSize -= BigInt(FourCcToken.len);
180
+ }
181
+ debug(`Channels: ${channels.join(", ")}`);
182
+ return channels;
183
+ }
184
+ };
185
+ export {
186
+ DsdiffContentParseError,
187
+ DsdiffParser
188
+ };
@@ -0,0 +1,110 @@
1
+ import {
2
+ AbstractID3Parser
3
+ } from "./chunk-3JKZUGPJ.js";
4
+ import {
5
+ ID3v2Parser
6
+ } from "./chunk-65JVFJ3X.js";
7
+ import "./chunk-2B4QMSZW.js";
8
+ import {
9
+ FourCcToken
10
+ } from "./chunk-YIHDW7JC.js";
11
+ import "./chunk-HNLU36CC.js";
12
+ import "./chunk-LREP5CZP.js";
13
+ import "./chunk-GD35BJSH.js";
14
+ import {
15
+ INT32_LE,
16
+ INT64_LE,
17
+ UINT64_LE,
18
+ makeUnexpectedFileContentError,
19
+ require_src
20
+ } from "./chunk-VGOIHW7D.js";
21
+ import {
22
+ __toESM
23
+ } from "./chunk-4VNS5WPM.js";
24
+
25
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/dsf/DsfParser.js
26
+ var import_debug = __toESM(require_src(), 1);
27
+
28
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/dsf/DsfChunk.js
29
+ var ChunkHeader = {
30
+ len: 12,
31
+ get: (buf, off) => {
32
+ return { id: FourCcToken.get(buf, off), size: UINT64_LE.get(buf, off + 4) };
33
+ }
34
+ };
35
+ var DsdChunk = {
36
+ len: 16,
37
+ get: (buf, off) => {
38
+ return {
39
+ fileSize: INT64_LE.get(buf, off),
40
+ metadataPointer: INT64_LE.get(buf, off + 8)
41
+ };
42
+ }
43
+ };
44
+ var FormatChunk = {
45
+ len: 40,
46
+ get: (buf, off) => {
47
+ return {
48
+ formatVersion: INT32_LE.get(buf, off),
49
+ formatID: INT32_LE.get(buf, off + 4),
50
+ channelType: INT32_LE.get(buf, off + 8),
51
+ channelNum: INT32_LE.get(buf, off + 12),
52
+ samplingFrequency: INT32_LE.get(buf, off + 16),
53
+ bitsPerSample: INT32_LE.get(buf, off + 20),
54
+ sampleCount: INT64_LE.get(buf, off + 24),
55
+ blockSizePerChannel: INT32_LE.get(buf, off + 32)
56
+ };
57
+ }
58
+ };
59
+
60
+ // ../../node_modules/.pnpm/music-metadata@11.12.0/node_modules/music-metadata/lib/dsf/DsfParser.js
61
+ var debug = (0, import_debug.default)("music-metadata:parser:DSF");
62
+ var DsdContentParseError = class extends makeUnexpectedFileContentError("DSD") {
63
+ };
64
+ var DsfParser = class extends AbstractID3Parser {
65
+ async postId3v2Parse() {
66
+ const p0 = this.tokenizer.position;
67
+ const chunkHeader = await this.tokenizer.readToken(ChunkHeader);
68
+ if (chunkHeader.id !== "DSD ")
69
+ throw new DsdContentParseError("Invalid chunk signature");
70
+ this.metadata.setFormat("container", "DSF");
71
+ this.metadata.setFormat("lossless", true);
72
+ this.metadata.setAudioOnly();
73
+ const dsdChunk = await this.tokenizer.readToken(DsdChunk);
74
+ if (dsdChunk.metadataPointer === BigInt(0)) {
75
+ debug("No ID3v2 tag present");
76
+ } else {
77
+ debug(`expect ID3v2 at offset=${dsdChunk.metadataPointer}`);
78
+ await this.parseChunks(dsdChunk.fileSize - chunkHeader.size);
79
+ await this.tokenizer.ignore(Number(dsdChunk.metadataPointer) - this.tokenizer.position - p0);
80
+ return new ID3v2Parser().parse(this.metadata, this.tokenizer, this.options);
81
+ }
82
+ }
83
+ async parseChunks(bytesRemaining) {
84
+ while (bytesRemaining >= ChunkHeader.len) {
85
+ const chunkHeader = await this.tokenizer.readToken(ChunkHeader);
86
+ debug(`Parsing chunk name=${chunkHeader.id} size=${chunkHeader.size}`);
87
+ switch (chunkHeader.id) {
88
+ case "fmt ": {
89
+ const formatChunk = await this.tokenizer.readToken(FormatChunk);
90
+ this.metadata.setFormat("numberOfChannels", formatChunk.channelNum);
91
+ this.metadata.setFormat("sampleRate", formatChunk.samplingFrequency);
92
+ this.metadata.setFormat("bitsPerSample", formatChunk.bitsPerSample);
93
+ this.metadata.setFormat("numberOfSamples", formatChunk.sampleCount);
94
+ this.metadata.setFormat("duration", Number(formatChunk.sampleCount) / formatChunk.samplingFrequency);
95
+ const bitrate = formatChunk.bitsPerSample * formatChunk.samplingFrequency * formatChunk.channelNum;
96
+ this.metadata.setFormat("bitrate", bitrate);
97
+ return;
98
+ }
99
+ default:
100
+ this.tokenizer.ignore(Number(chunkHeader.size) - ChunkHeader.len);
101
+ break;
102
+ }
103
+ bytesRemaining -= chunkHeader.size;
104
+ }
105
+ }
106
+ };
107
+ export {
108
+ DsdContentParseError,
109
+ DsfParser
110
+ };
@@ -0,0 +1,15 @@
1
+ import {
2
+ FlacParser
3
+ } from "./chunk-AGSFUVRG.js";
4
+ import "./chunk-3JKZUGPJ.js";
5
+ import "./chunk-65JVFJ3X.js";
6
+ import "./chunk-2B4QMSZW.js";
7
+ import "./chunk-YIHDW7JC.js";
8
+ import "./chunk-HNLU36CC.js";
9
+ import "./chunk-LREP5CZP.js";
10
+ import "./chunk-GD35BJSH.js";
11
+ import "./chunk-VGOIHW7D.js";
12
+ import "./chunk-4VNS5WPM.js";
13
+ export {
14
+ FlacParser
15
+ };