taglib-wasm 2.3.1 → 2.4.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/LICENSE +0 -29
- package/NOTICE +35 -0
- package/README.md +37 -33
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/assertClassBrand.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/checkPrivateRedeclaration.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/classPrivateFieldGet2.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/classPrivateFieldInitSpec.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/classPrivateFieldSet2.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/defineProperty.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/toPrimitive.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/toPropertyKey.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/typeof.js +1 -1
- package/dist/_virtual/{_@oxc-project_runtime@0.152.0 → _@oxc-project_runtime@0.154.0}/helpers/esm/usingCtx.js +1 -1
- package/dist/constants/properties.d.ts +5 -839
- package/dist/constants/properties.d.ts.map +1 -1
- package/dist/constants/properties.js +2 -0
- package/dist/constants/specialized-properties.d.ts +14 -0
- package/dist/constants/specialized-properties.d.ts.map +1 -1
- package/dist/constants/specialized-properties.js +21 -0
- package/dist/deno-compile.d.ts +8 -4
- package/dist/deno-compile.d.ts.map +1 -1
- package/dist/deno-compile.js +9 -5
- package/dist/index.browser.js +36 -8
- package/dist/rating.js +1 -2
- package/dist/runtime/deno-detect.d.ts +11 -0
- package/dist/runtime/deno-detect.d.ts.map +1 -1
- package/dist/runtime/deno-detect.js +15 -1
- package/dist/runtime/platform-io.d.ts.map +1 -1
- package/dist/runtime/platform-io.js +15 -0
- package/dist/runtime/wasi-adapter/adapter.js +1 -1
- package/dist/runtime/wasi-adapter/audio-properties.d.ts.map +1 -1
- package/dist/runtime/wasi-adapter/audio-properties.js +1 -1
- package/dist/runtime/wasi-adapter/file-handle.js +1 -1
- package/dist/runtime/wasi-adapter/index.js +1 -2
- package/dist/runtime/wasi-adapter/wasm-io.js +1 -1
- package/dist/runtime/wasi-memory.js +3 -3
- package/dist/simple/picture-operations.d.ts +6 -0
- package/dist/simple/picture-operations.d.ts.map +1 -1
- package/dist/simple/picture-operations.js +6 -0
- package/dist/simple/tag-operations.d.ts +7 -0
- package/dist/simple/tag-operations.d.ts.map +1 -1
- package/dist/simple/tag-operations.js +7 -0
- package/dist/simple/with-audio-file.d.ts.map +1 -1
- package/dist/simple/with-audio-file.js +2 -1
- package/dist/simple.browser.js +32 -7
- package/dist/taglib/audio-file-base.js +1 -1
- package/dist/taglib/audio-file-impl.js +1 -1
- package/dist/taglib/embind-adapter.d.ts.map +1 -1
- package/dist/taglib/embind-adapter.js +2 -1
- package/dist/taglib/taglib-class.js +1 -1
- package/dist/taglib-wasi.wasm +0 -0
- package/dist/taglib-web.wasm +0 -0
- package/dist/taglib-wrapper.js +1 -1
- package/dist/types/audio-formats.d.ts +5 -1
- package/dist/types/audio-formats.d.ts.map +1 -1
- package/dist/types/metadata-mappings.d.ts.map +1 -1
- package/dist/types/metadata-mappings.js +8 -0
- package/dist/types/tags.d.ts +4 -0
- package/dist/types/tags.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/web.browser.js +32 -7
- package/legal/COPYING.LGPL +502 -0
- package/package.json +34 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/constants/properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../src/constants/properties.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAUrE,eAAO,MAAM,UAAU,EAAE,OAAO,gBAAgB,GAC9C,OAAO,2BAA2B,GAClC,OAAO,sBAAsB,GAC7B,OAAO,qBAKC,CAAC;AAEX;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,UAAU,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,WAAW,IAC7C,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GAC3C,MAAM,GACN,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,QAAQ,GAC7C,MAAM,GACN,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,SAAS,GAC9C,OAAO,GACP,MAAM,CAAC;AAoDjB,mGAAmG;AACnG,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE/C;AAsDD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE/D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,MAAM,EAAE,CAOzE;AAED,mGAAmG;AACnG,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GACrB,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CASnB;AAGD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -41,6 +41,8 @@ const READ_ALIASES = {
|
|
|
41
41
|
TOTALDISCS: "DISCTOTAL",
|
|
42
42
|
MUSICBRAINZ_ALBUMTYPE: "RELEASETYPE",
|
|
43
43
|
"MusicBrainz Album Type": "RELEASETYPE",
|
|
44
|
+
MUSICBRAINZ_ALBUMSTATUS: "RELEASESTATUS",
|
|
45
|
+
"MusicBrainz Album Status": "RELEASESTATUS",
|
|
44
46
|
CONTENTADVISORY: "ITUNESADVISORY",
|
|
45
47
|
EXPLICIT: "ITUNESADVISORY"
|
|
46
48
|
};
|
|
@@ -87,6 +87,20 @@ export declare const SPECIALIZED_PROPERTIES: {
|
|
|
87
87
|
readonly mp4: "----:com.apple.iTunes:MusicBrainz Album Release Country";
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
+
readonly releaseStatus: {
|
|
91
|
+
readonly key: "RELEASESTATUS";
|
|
92
|
+
readonly description: "Release status (official, promotion, bootleg, ...). TagLib 2.3.2 translates the RELEASESTATUS key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM STATUS' (TagLib's description casing), MP4 freeform atom 'MusicBrainz Album Status', APEv2 MUSICBRAINZ_ALBUMSTATUS, ASF 'MusicBrainz/Album Status', Vorbis/Matroska raw RELEASESTATUS";
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly supportedFormats: readonly ["ID3v2", "MP4", "Vorbis", "APE", "ASF", "Matroska"];
|
|
95
|
+
readonly mappings: {
|
|
96
|
+
readonly id3v2: {
|
|
97
|
+
readonly frame: "TXXX";
|
|
98
|
+
readonly description: "MusicBrainz Album Status";
|
|
99
|
+
};
|
|
100
|
+
readonly vorbis: "RELEASESTATUS";
|
|
101
|
+
readonly mp4: "----:com.apple.iTunes:MusicBrainz Album Status";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
90
104
|
readonly itunesAdvisory: {
|
|
91
105
|
readonly key: "ITUNESADVISORY";
|
|
92
106
|
readonly description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specialized-properties.d.ts","sourceRoot":"","sources":["../../src/constants/specialized-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"specialized-properties.d.ts","sourceRoot":"","sources":["../../src/constants/specialized-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkOjC;;;;;;;;OAQG;;;;;;;;;;;;;;;CAYK,CAAC"}
|
|
@@ -119,6 +119,27 @@ const SPECIALIZED_PROPERTIES = {
|
|
|
119
119
|
mp4: "----:com.apple.iTunes:MusicBrainz Album Release Country"
|
|
120
120
|
}
|
|
121
121
|
},
|
|
122
|
+
releaseStatus: {
|
|
123
|
+
key: "RELEASESTATUS",
|
|
124
|
+
description: "Release status (official, promotion, bootleg, ...). TagLib 2.3.2 translates the RELEASESTATUS key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM STATUS' (TagLib's description casing), MP4 freeform atom 'MusicBrainz Album Status', APEv2 MUSICBRAINZ_ALBUMSTATUS, ASF 'MusicBrainz/Album Status', Vorbis/Matroska raw RELEASESTATUS",
|
|
125
|
+
type: "string",
|
|
126
|
+
supportedFormats: [
|
|
127
|
+
"ID3v2",
|
|
128
|
+
"MP4",
|
|
129
|
+
"Vorbis",
|
|
130
|
+
"APE",
|
|
131
|
+
"ASF",
|
|
132
|
+
"Matroska"
|
|
133
|
+
],
|
|
134
|
+
mappings: {
|
|
135
|
+
id3v2: {
|
|
136
|
+
frame: "TXXX",
|
|
137
|
+
description: "MusicBrainz Album Status"
|
|
138
|
+
},
|
|
139
|
+
vorbis: "RELEASESTATUS",
|
|
140
|
+
mp4: "----:com.apple.iTunes:MusicBrainz Album Status"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
122
143
|
itunesAdvisory: {
|
|
123
144
|
key: "ITUNESADVISORY",
|
|
124
145
|
description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here",
|
package/dist/deno-compile.d.ts
CHANGED
|
@@ -24,10 +24,14 @@ export declare const WASM_EMBED_SEARCH_PATHS: readonly string[];
|
|
|
24
24
|
* Initialize TagLib with automatic handling for Deno compiled binaries.
|
|
25
25
|
*
|
|
26
26
|
* In compiled binaries, this function attempts to load embedded WASM from a
|
|
27
|
-
* specified path relative to the binary.
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
27
|
+
* specified path relative to the binary. Both that attempt and the detection
|
|
28
|
+
* above are gated on `isDenoCompiled()`, which recognizes both compiled-binary
|
|
29
|
+
* main-module forms (the `deno-compile://` scheme through Deno 2.8, and the
|
|
30
|
+
* `file://` URL under a `deno-compile-<name>` path on Deno 2.9+). When no
|
|
31
|
+
* embedded file is found it falls back to the Wasm resolved from this package.
|
|
32
|
+
* `deno compile` embeds the whole package tree, so that fallback is present
|
|
33
|
+
* inside a compiled binary too: `--include` pins the copy you tested rather
|
|
34
|
+
* than repairing a missing file.
|
|
31
35
|
*
|
|
32
36
|
* @param embeddedWasmPath - Path to embedded WASM file (default: './taglib-web.wasm')
|
|
33
37
|
* @returns Promise resolving to initialized TagLib instance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deno-compile.d.ts","sourceRoot":"","sources":["../src/deno-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAIpD,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"deno-compile.d.ts","sourceRoot":"","sources":["../src/deno-compile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAIpD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,wBAAwB,CAC5C,gBAAgB,SAAsB,GACrC,OAAO,CAAC,MAAM,CAAC,CAiCjB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,UAAU,SAAsB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAuCf"}
|
package/dist/deno-compile.js
CHANGED
|
@@ -32,10 +32,14 @@ const WASM_EMBED_SEARCH_PATHS = [
|
|
|
32
32
|
* Initialize TagLib with automatic handling for Deno compiled binaries.
|
|
33
33
|
*
|
|
34
34
|
* In compiled binaries, this function attempts to load embedded WASM from a
|
|
35
|
-
* specified path relative to the binary.
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* specified path relative to the binary. Both that attempt and the detection
|
|
36
|
+
* above are gated on `isDenoCompiled()`, which recognizes both compiled-binary
|
|
37
|
+
* main-module forms (the `deno-compile://` scheme through Deno 2.8, and the
|
|
38
|
+
* `file://` URL under a `deno-compile-<name>` path on Deno 2.9+). When no
|
|
39
|
+
* embedded file is found it falls back to the Wasm resolved from this package.
|
|
40
|
+
* `deno compile` embeds the whole package tree, so that fallback is present
|
|
41
|
+
* inside a compiled binary too: `--include` pins the copy you tested rather
|
|
42
|
+
* than repairing a missing file.
|
|
39
43
|
*
|
|
40
44
|
* @param embeddedWasmPath - Path to embedded WASM file (default: './taglib-web.wasm')
|
|
41
45
|
* @returns Promise resolving to initialized TagLib instance
|
|
@@ -67,7 +71,7 @@ async function initializeForDenoCompile(embeddedWasmPath = "./taglib-web.wasm")
|
|
|
67
71
|
});
|
|
68
72
|
} catch {}
|
|
69
73
|
console.warn(`Could not load embedded WASM from ${embeddedWasmPath}`);
|
|
70
|
-
console.warn("Falling back to
|
|
74
|
+
console.warn("Falling back to the Wasm shipped in this package (not a network fetch)");
|
|
71
75
|
}
|
|
72
76
|
return await TagLib.initialize({ forceWasmType: "emscripten" });
|
|
73
77
|
}
|
package/dist/index.browser.js
CHANGED
|
@@ -1371,6 +1371,27 @@ var init_specialized_properties = __esmMin((() => {
|
|
|
1371
1371
|
mp4: "----:com.apple.iTunes:MusicBrainz Album Release Country"
|
|
1372
1372
|
}
|
|
1373
1373
|
},
|
|
1374
|
+
releaseStatus: {
|
|
1375
|
+
key: "RELEASESTATUS",
|
|
1376
|
+
description: "Release status (official, promotion, bootleg, ...). TagLib 2.3.2 translates the RELEASESTATUS key per format: ID3v2 TXXX 'MUSICBRAINZ ALBUM STATUS' (TagLib's description casing), MP4 freeform atom 'MusicBrainz Album Status', APEv2 MUSICBRAINZ_ALBUMSTATUS, ASF 'MusicBrainz/Album Status', Vorbis/Matroska raw RELEASESTATUS",
|
|
1377
|
+
type: "string",
|
|
1378
|
+
supportedFormats: [
|
|
1379
|
+
"ID3v2",
|
|
1380
|
+
"MP4",
|
|
1381
|
+
"Vorbis",
|
|
1382
|
+
"APE",
|
|
1383
|
+
"ASF",
|
|
1384
|
+
"Matroska"
|
|
1385
|
+
],
|
|
1386
|
+
mappings: {
|
|
1387
|
+
id3v2: {
|
|
1388
|
+
frame: "TXXX",
|
|
1389
|
+
description: "MusicBrainz Album Status"
|
|
1390
|
+
},
|
|
1391
|
+
vorbis: "RELEASESTATUS",
|
|
1392
|
+
mp4: "----:com.apple.iTunes:MusicBrainz Album Status"
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1374
1395
|
itunesAdvisory: {
|
|
1375
1396
|
key: "ITUNESADVISORY",
|
|
1376
1397
|
description: "Content advisory in the ITUNESADVISORY convention ('1' = explicit, '2' = clean, '0' = unspecified). On MP4 the value is stored in the native rtng atom and surfaced here. The typed tri-state lives on ExtendedTag.advisory; aliases CONTENTADVISORY and EXPLICIT resolve here",
|
|
@@ -1637,6 +1658,8 @@ var init_properties = __esmMin((() => {
|
|
|
1637
1658
|
TOTALDISCS: "DISCTOTAL",
|
|
1638
1659
|
MUSICBRAINZ_ALBUMTYPE: "RELEASETYPE",
|
|
1639
1660
|
"MusicBrainz Album Type": "RELEASETYPE",
|
|
1661
|
+
MUSICBRAINZ_ALBUMSTATUS: "RELEASESTATUS",
|
|
1662
|
+
"MusicBrainz Album Status": "RELEASESTATUS",
|
|
1640
1663
|
CONTENTADVISORY: "ITUNESADVISORY",
|
|
1641
1664
|
EXPLICIT: "ITUNESADVISORY"
|
|
1642
1665
|
};
|
|
@@ -1763,7 +1786,7 @@ var init_auto_dispose = __esmMin((() => {
|
|
|
1763
1786
|
});
|
|
1764
1787
|
}));
|
|
1765
1788
|
//#endregion
|
|
1766
|
-
//#region \0@oxc-project+runtime@0.
|
|
1789
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/typeof.js
|
|
1767
1790
|
function _typeof(o) {
|
|
1768
1791
|
"@babel/helpers - typeof";
|
|
1769
1792
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -1774,7 +1797,7 @@ function _typeof(o) {
|
|
|
1774
1797
|
}
|
|
1775
1798
|
var init_typeof = __esmMin((() => {}));
|
|
1776
1799
|
//#endregion
|
|
1777
|
-
//#region \0@oxc-project+runtime@0.
|
|
1800
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPrimitive.js
|
|
1778
1801
|
function toPrimitive(t, r) {
|
|
1779
1802
|
if ("object" != _typeof(t) || !t) return t;
|
|
1780
1803
|
var e = t[Symbol.toPrimitive];
|
|
@@ -1789,7 +1812,7 @@ var init_toPrimitive = __esmMin((() => {
|
|
|
1789
1812
|
init_typeof();
|
|
1790
1813
|
}));
|
|
1791
1814
|
//#endregion
|
|
1792
|
-
//#region \0@oxc-project+runtime@0.
|
|
1815
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/toPropertyKey.js
|
|
1793
1816
|
function toPropertyKey(t) {
|
|
1794
1817
|
var i = toPrimitive(t, "string");
|
|
1795
1818
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
@@ -1799,7 +1822,7 @@ var init_toPropertyKey = __esmMin((() => {
|
|
|
1799
1822
|
init_toPrimitive();
|
|
1800
1823
|
}));
|
|
1801
1824
|
//#endregion
|
|
1802
|
-
//#region \0@oxc-project+runtime@0.
|
|
1825
|
+
//#region \0@oxc-project+runtime@0.154.0/helpers/esm/defineProperty.js
|
|
1803
1826
|
function _defineProperty(e, r, t) {
|
|
1804
1827
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1805
1828
|
value: t,
|
|
@@ -2631,6 +2654,7 @@ function wrapEmbindHandle(raw) {
|
|
|
2631
2654
|
const mpegVersion = pw.mpegVersion();
|
|
2632
2655
|
const formatVersion = pw.formatVersion();
|
|
2633
2656
|
const bitrateMode = pw.bitrateMode();
|
|
2657
|
+
const isEncrypted = pw.isEncrypted();
|
|
2634
2658
|
return {
|
|
2635
2659
|
duration: pw.lengthInSeconds(),
|
|
2636
2660
|
durationMs: pw.lengthInMilliseconds(),
|
|
@@ -2645,7 +2669,7 @@ function wrapEmbindHandle(raw) {
|
|
|
2645
2669
|
mpegVersion,
|
|
2646
2670
|
mpegLayer: pw.mpegLayer()
|
|
2647
2671
|
} : {},
|
|
2648
|
-
...containerFormat === "MP4" || containerFormat === "ASF" ? { isEncrypted
|
|
2672
|
+
...isEncrypted || containerFormat === "MP4" || containerFormat === "ASF" ? { isEncrypted } : {},
|
|
2649
2673
|
...formatVersion > 0 ? { formatVersion } : {},
|
|
2650
2674
|
...isValidBitrateMode(bitrateMode) ? { bitrateMode } : {},
|
|
2651
2675
|
...containerFormat === "OGG" && codec === "Opus" ? { outputGainDb: pw.outputGainDb() } : {}
|
|
@@ -3248,7 +3272,7 @@ var init_tag_mapping = __esmMin((() => {
|
|
|
3248
3272
|
//#region src/version.ts
|
|
3249
3273
|
var VERSION;
|
|
3250
3274
|
var init_version = __esmMin((() => {
|
|
3251
|
-
VERSION = "2.
|
|
3275
|
+
VERSION = "2.4.1";
|
|
3252
3276
|
}));
|
|
3253
3277
|
//#endregion
|
|
3254
3278
|
//#region src/runtime/module-loader-browser.ts
|
|
@@ -3427,7 +3451,10 @@ var init_taglib = __esmMin((() => {
|
|
|
3427
3451
|
//#region src/runtime/deno-detect.ts
|
|
3428
3452
|
init_taglib();
|
|
3429
3453
|
function isDenoCompiled() {
|
|
3430
|
-
|
|
3454
|
+
if (typeof Deno === "undefined") return false;
|
|
3455
|
+
const build = Deno.build;
|
|
3456
|
+
if (typeof build?.standalone === "boolean") return build.standalone;
|
|
3457
|
+
return typeof Deno.mainModule === "string" && (Deno.mainModule.includes("deno-compile://") || Deno.mainModule.includes("/deno-compile-"));
|
|
3431
3458
|
}
|
|
3432
3459
|
//#endregion
|
|
3433
3460
|
//#region src/simple/config.ts
|
|
@@ -3448,6 +3475,7 @@ async function getTagLib() {
|
|
|
3448
3475
|
//#endregion
|
|
3449
3476
|
//#region src/simple/with-audio-file.ts
|
|
3450
3477
|
init_errors();
|
|
3478
|
+
init_file();
|
|
3451
3479
|
async function withAudioFile(file, fn, options) {
|
|
3452
3480
|
const audioFile = await (await getTagLib()).open(file, options);
|
|
3453
3481
|
try {
|
|
@@ -3458,7 +3486,7 @@ async function withAudioFile(file, fn, options) {
|
|
|
3458
3486
|
}
|
|
3459
3487
|
}
|
|
3460
3488
|
async function withAudioFileSave(file, fn) {
|
|
3461
|
-
return withAudioFile(file, (audioFile) => {
|
|
3489
|
+
return withAudioFile(typeof file === "string" ? await readFileData(file) : file, (audioFile) => {
|
|
3462
3490
|
fn(audioFile);
|
|
3463
3491
|
if (!audioFile.save()) throw new FileOperationError("save", "Failed to save metadata changes. The file may be read-only or corrupted.");
|
|
3464
3492
|
return audioFile.getFileBuffer();
|
package/dist/rating.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { RatingUtils, clamp, fromNormalized, fromPercent, fromPopm, fromStars, isValid, normalized, popm, toNormalized, toPercent, toPopm, toStars };
|
|
1
|
+
export { RatingUtils, clamp, fromNormalized, fromPercent, fromPopm, fromStars, isValid, normalized, popm, toNormalized, toPercent, toPopm, toStars } from "./utils/rating.js";
|
|
@@ -4,5 +4,16 @@
|
|
|
4
4
|
* Shared by module-loader.ts and deno-compile.ts to avoid duplication.
|
|
5
5
|
* Intentionally zero-dependency to prevent circular imports.
|
|
6
6
|
*/
|
|
7
|
+
/**
|
|
8
|
+
* Whether the process is a Deno compiled binary.
|
|
9
|
+
*
|
|
10
|
+
* `Deno.build.standalone` is the runtime's own statement — true inside a
|
|
11
|
+
* compiled binary, false under `deno run` (measured on 2.9.6) — so it wins
|
|
12
|
+
* whenever it is exposed. A path that merely contains a `deno-compile-`
|
|
13
|
+
* directory must not count; the main-module forms below are only the fallback
|
|
14
|
+
* for runtimes (or test doubles) without the flag: Deno through 2.8 marks a
|
|
15
|
+
* compiled binary with the `deno-compile://` scheme, and Deno 2.9+ reports a
|
|
16
|
+
* `file://` URL under a `deno-compile-<name>` temporary directory.
|
|
17
|
+
*/
|
|
7
18
|
export declare function isDenoCompiled(): boolean;
|
|
8
19
|
//# sourceMappingURL=deno-detect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deno-detect.d.ts","sourceRoot":"","sources":["../../src/runtime/deno-detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,wBAAgB,cAAc,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"deno-detect.d.ts","sourceRoot":"","sources":["../../src/runtime/deno-detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAWxC"}
|
|
@@ -5,8 +5,22 @@
|
|
|
5
5
|
* Shared by module-loader.ts and deno-compile.ts to avoid duplication.
|
|
6
6
|
* Intentionally zero-dependency to prevent circular imports.
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Whether the process is a Deno compiled binary.
|
|
10
|
+
*
|
|
11
|
+
* `Deno.build.standalone` is the runtime's own statement — true inside a
|
|
12
|
+
* compiled binary, false under `deno run` (measured on 2.9.6) — so it wins
|
|
13
|
+
* whenever it is exposed. A path that merely contains a `deno-compile-`
|
|
14
|
+
* directory must not count; the main-module forms below are only the fallback
|
|
15
|
+
* for runtimes (or test doubles) without the flag: Deno through 2.8 marks a
|
|
16
|
+
* compiled binary with the `deno-compile://` scheme, and Deno 2.9+ reports a
|
|
17
|
+
* `file://` URL under a `deno-compile-<name>` temporary directory.
|
|
18
|
+
*/
|
|
8
19
|
function isDenoCompiled() {
|
|
9
|
-
|
|
20
|
+
if (typeof Deno === "undefined") return false;
|
|
21
|
+
const build = Deno.build;
|
|
22
|
+
if (typeof build?.standalone === "boolean") return build.standalone;
|
|
23
|
+
return typeof Deno.mainModule === "string" && (Deno.mainModule.includes("deno-compile://") || Deno.mainModule.includes("/deno-compile-"));
|
|
10
24
|
}
|
|
11
25
|
//#endregion
|
|
12
26
|
export { isDenoCompiled };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-io.d.ts","sourceRoot":"","sources":["../../src/runtime/platform-io.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,OAAO,CACL,IAAI,EAAE,MAAM,GACX,cAAc,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC3E,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"platform-io.d.ts","sourceRoot":"","sources":["../../src/runtime/platform-io.ts"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC5C,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzD,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,OAAO,CACL,IAAI,EAAE,MAAM,GACX,cAAc,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC3E,WAAW,CAAC,EAAE,CACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1B,CAAC;AA2NF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,kBAAkB,GAAG,UAAU,CAgBvE;AAED,wBAAgB,aAAa,IAAI,UAAU,CAM1C;AAED,gBAAgB;AAChB,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,UAAU,GAAG,IAAI,CAE7D;AAED,gBAAgB;AAChB,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC"}
|
|
@@ -118,6 +118,21 @@ function createBunIO() {
|
|
|
118
118
|
isDirectory: entry.isDirectory(),
|
|
119
119
|
isFile: entry.isFile()
|
|
120
120
|
};
|
|
121
|
+
},
|
|
122
|
+
readPartial: async (path, headerSize, footerSize) => {
|
|
123
|
+
const file = B.file(path);
|
|
124
|
+
const fileSize = file.size;
|
|
125
|
+
const full = await readFullFile(async (p) => new Uint8Array(await B.file(p).arrayBuffer()), path, headerSize, footerSize, fileSize);
|
|
126
|
+
if (full) return full;
|
|
127
|
+
const actualHeader = Math.min(headerSize, fileSize);
|
|
128
|
+
const header = new Uint8Array(await file.slice(0, actualHeader).arrayBuffer());
|
|
129
|
+
const actualFooter = Math.min(footerSize, fileSize);
|
|
130
|
+
const footerStart = fileSize - actualFooter;
|
|
131
|
+
const footer = new Uint8Array(await file.slice(footerStart, fileSize).arrayBuffer());
|
|
132
|
+
const combined = new Uint8Array(actualHeader + actualFooter);
|
|
133
|
+
combined.set(header, 0);
|
|
134
|
+
combined.set(footer, actualHeader);
|
|
135
|
+
return combined;
|
|
121
136
|
}
|
|
122
137
|
};
|
|
123
138
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MemoryError } from "../../errors/classes.js";
|
|
2
|
-
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.
|
|
2
|
+
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.js";
|
|
3
3
|
import { WasmerExecutionError } from "../wasmer-sdk-loader/types.js";
|
|
4
4
|
import { WasiFileHandle } from "./file-handle.js";
|
|
5
5
|
import { openAudioPath } from "./path-open.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audio-properties.d.ts","sourceRoot":"","sources":["../../../src/runtime/wasi-adapter/audio-properties.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AA6CxB,wEAAwE;AACxE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACtC,eAAe,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"audio-properties.d.ts","sourceRoot":"","sources":["../../../src/runtime/wasi-adapter/audio-properties.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,gBAAgB,CAAC;AA6CxB,wEAAwE;AACxE,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GACtC,eAAe,GAAG,IAAI,CAkCxB;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CA0B3D;AAED;;;GAGG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACvC,QAAQ,EAAE,UAAU,GAAG,IAAI,GAC1B,MAAM,CAiFR;AAED,4EAA4E;AAC5E,wBAAgB,KAAK,CACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACvC,QAAQ,EAAE,UAAU,GAAG,IAAI,GAC1B,OAAO,CAYT"}
|
|
@@ -61,7 +61,7 @@ function getAudioProperties(tagData) {
|
|
|
61
61
|
mpegVersion,
|
|
62
62
|
mpegLayer: d.mpegLayer ?? 0
|
|
63
63
|
} : {},
|
|
64
|
-
...containerFormat === "MP4" || containerFormat === "ASF" ? { isEncrypted:
|
|
64
|
+
...d.isEncrypted === true ? { isEncrypted: true } : containerFormat === "MP4" || containerFormat === "ASF" ? { isEncrypted: false } : {},
|
|
65
65
|
...formatVersion > 0 ? { formatVersion } : {},
|
|
66
66
|
...d.outputGainDb !== void 0 ? { outputGainDb: d.outputGainDb } : {}
|
|
67
67
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.
|
|
1
|
+
import _defineProperty from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/defineProperty.js";
|
|
2
2
|
import { WasmerExecutionError } from "../wasmer-sdk-loader/types.js";
|
|
3
3
|
import { createHandleState, destroy, getBuffer, isValid, loadBuffer, loadPath, save } from "./handle-state.js";
|
|
4
4
|
import { getAudioProperties, getFormat, isMP4 } from "./audio-properties.js";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { WasiToTagLibAdapter };
|
|
1
|
+
export { WasiToTagLibAdapter } from "./adapter.js";
|
|
@@ -2,7 +2,7 @@ import { FileOperationError, InvalidFormatError, UnsupportedFormatError } from "
|
|
|
2
2
|
import { decodeMessagePack } from "../../msgpack/decoder.js";
|
|
3
3
|
import { encodeTagData } from "../../msgpack/encoder.js";
|
|
4
4
|
import { WasmArena, WasmMemoryError } from "../wasi-memory.js";
|
|
5
|
-
import _usingCtx from "../../_virtual/_@oxc-project_runtime@0.
|
|
5
|
+
import _usingCtx from "../../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/usingCtx.js";
|
|
6
6
|
//#region src/runtime/wasi-adapter/wasm-io.ts
|
|
7
7
|
const TL_ERROR_INVALID_INPUT = -1;
|
|
8
8
|
const TL_ERROR_UNSUPPORTED_FORMAT = -2;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TagLibError } from "../errors/base.js";
|
|
2
2
|
import { MemoryError } from "../errors/classes.js";
|
|
3
|
-
import _classPrivateFieldInitSpec from "../_virtual/_@oxc-project_runtime@0.
|
|
4
|
-
import _classPrivateFieldSet2 from "../_virtual/_@oxc-project_runtime@0.
|
|
5
|
-
import _classPrivateFieldGet2 from "../_virtual/_@oxc-project_runtime@0.
|
|
3
|
+
import _classPrivateFieldInitSpec from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/classPrivateFieldInitSpec.js";
|
|
4
|
+
import _classPrivateFieldSet2 from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/classPrivateFieldSet2.js";
|
|
5
|
+
import _classPrivateFieldGet2 from "../_virtual/_@oxc-project_runtime@0.154.0/helpers/esm/classPrivateFieldGet2.js";
|
|
6
6
|
//#region src/runtime/wasi-memory.ts
|
|
7
7
|
/**
|
|
8
8
|
* @fileoverview RAII Memory Management for WASI
|
|
@@ -11,6 +11,9 @@ export declare function readPictures(file: AudioFileInput): Promise<Picture[]>;
|
|
|
11
11
|
/**
|
|
12
12
|
* Replaces all embedded pictures in an audio file and returns the modified content as a buffer.
|
|
13
13
|
*
|
|
14
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
15
|
+
* so the file on disk is left untouched.
|
|
16
|
+
*
|
|
14
17
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
15
18
|
* @param pictures - Complete set of pictures to embed; replaces any existing pictures
|
|
16
19
|
* @returns Modified audio file contents with the updated picture set
|
|
@@ -22,6 +25,9 @@ export declare function applyPictures(file: AudioFileInput, pictures: Picture[])
|
|
|
22
25
|
/**
|
|
23
26
|
* Appends a single picture to an audio file's existing embedded pictures.
|
|
24
27
|
*
|
|
28
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
29
|
+
* so the file on disk is left untouched.
|
|
30
|
+
*
|
|
25
31
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
26
32
|
* @param picture - Picture to append to the file
|
|
27
33
|
* @returns Modified audio file contents with the new picture added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"picture-operations.d.ts","sourceRoot":"","sources":["../../src/simple/picture-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGxE;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAE3E;AAED
|
|
1
|
+
{"version":3,"file":"picture-operations.d.ts","sourceRoot":"","sources":["../../src/simple/picture-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGxE;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAE3E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,OAAO,EAAE,GAClB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAE7E;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAYjC;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CACjC,IAAI,EAAE,cAAc,EACpB,SAAS,EAAE,UAAU,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,CAAC,CAQrB;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,GAAG,SAAS,CAErB;AAED;;;;;;;;;GASG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,UAAU,CAAC,CAUrB;AAED;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CACtE,KAAK,CAAC;IACJ,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CACH,CAQA"}
|
|
@@ -14,6 +14,9 @@ async function readPictures(file) {
|
|
|
14
14
|
/**
|
|
15
15
|
* Replaces all embedded pictures in an audio file and returns the modified content as a buffer.
|
|
16
16
|
*
|
|
17
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
18
|
+
* so the file on disk is left untouched.
|
|
19
|
+
*
|
|
17
20
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
18
21
|
* @param pictures - Complete set of pictures to embed; replaces any existing pictures
|
|
19
22
|
* @returns Modified audio file contents with the updated picture set
|
|
@@ -29,6 +32,9 @@ async function applyPictures(file, pictures) {
|
|
|
29
32
|
/**
|
|
30
33
|
* Appends a single picture to an audio file's existing embedded pictures.
|
|
31
34
|
*
|
|
35
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
36
|
+
* so the file on disk is left untouched.
|
|
37
|
+
*
|
|
32
38
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
33
39
|
* @param picture - Picture to append to the file
|
|
34
40
|
* @returns Modified audio file contents with the new picture added
|
|
@@ -15,6 +15,10 @@ export declare function readTags(file: AudioFileInput, options?: {
|
|
|
15
15
|
/**
|
|
16
16
|
* Applies metadata tag changes to an audio file and returns the modified content as a buffer.
|
|
17
17
|
*
|
|
18
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
19
|
+
* so the file on disk is left untouched. Use {@link applyTagsToFile} for an
|
|
20
|
+
* in-place update.
|
|
21
|
+
*
|
|
18
22
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
19
23
|
* @param tags - Partial tag fields to merge with existing metadata
|
|
20
24
|
* @returns Modified audio file contents with updated tags
|
|
@@ -63,6 +67,9 @@ export declare function readFormat(file: AudioFileInput): Promise<FileType | und
|
|
|
63
67
|
/**
|
|
64
68
|
* Removes all metadata tags and pictures from an audio file and returns the stripped content.
|
|
65
69
|
*
|
|
70
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
71
|
+
* so the file on disk is left untouched.
|
|
72
|
+
*
|
|
66
73
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
67
74
|
* @returns Modified audio file contents with all tags and pictures cleared
|
|
68
75
|
* @throws {TagLibInitializationError} If the Wasm module fails to initialize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag-operations.d.ts","sourceRoot":"","sources":["../../src/simple/tag-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EAER,QAAQ,EACT,MAAM,aAAa,CAAC;AAWrB;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GAC7C,OAAO,CAAC,WAAW,CAAC,CAItB;AAED
|
|
1
|
+
{"version":3,"file":"tag-operations.d.ts","sourceRoot":"","sources":["../../src/simple/tag-operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,WAAW,EACX,QAAQ,EAER,QAAQ,EACT,MAAM,aAAa,CAAC;AAWrB;;;;;;;;;GASG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAAO,GAC7C,OAAO,CAAC,WAAW,CAAC,CAItB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,SAAS,CAC7B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,CAIrB;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GACtB,OAAO,CAAC,IAAI,CAAC,CAWf;AAED;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAY1B;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAY7E;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC,CAW/B;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBzE"}
|
|
@@ -20,6 +20,10 @@ async function readTags(file, options = {}) {
|
|
|
20
20
|
/**
|
|
21
21
|
* Applies metadata tag changes to an audio file and returns the modified content as a buffer.
|
|
22
22
|
*
|
|
23
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
24
|
+
* so the file on disk is left untouched. Use {@link applyTagsToFile} for an
|
|
25
|
+
* in-place update.
|
|
26
|
+
*
|
|
23
27
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
24
28
|
* @param tags - Partial tag fields to merge with existing metadata
|
|
25
29
|
* @returns Modified audio file contents with updated tags
|
|
@@ -102,6 +106,9 @@ async function readFormat(file) {
|
|
|
102
106
|
/**
|
|
103
107
|
* Removes all metadata tags and pictures from an audio file and returns the stripped content.
|
|
104
108
|
*
|
|
109
|
+
* The input is read, never written: a path is only where the bytes come from,
|
|
110
|
+
* so the file on disk is left untouched.
|
|
111
|
+
*
|
|
105
112
|
* @param file - File path, Uint8Array, ArrayBuffer, or File object
|
|
106
113
|
* @returns Modified audio file contents with all tags and pictures cleared
|
|
107
114
|
* @throws {TagLibInitializationError} If the Wasm module fails to initialize
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-audio-file.d.ts","sourceRoot":"","sources":["../../src/simple/with-audio-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"with-audio-file.d.ts","sourceRoot":"","sources":["../../src/simple/with-audio-file.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAK/D,wBAAsB,aAAa,CAAC,CAAC,EACnC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,EAC5C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,CAAC,CAAC,CAaZ;AAED,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GACjC,OAAO,CAAC,UAAU,CAAC,CAoBrB;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,GACjC,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FileOperationError, InvalidFormatError } from "../errors/classes.js";
|
|
2
2
|
import "../errors.js";
|
|
3
|
+
import { readFileData } from "../utils/file.js";
|
|
3
4
|
import { getTagLib } from "./config.js";
|
|
4
5
|
//#region src/simple/with-audio-file.ts
|
|
5
6
|
async function withAudioFile(file, fn, options) {
|
|
@@ -12,7 +13,7 @@ async function withAudioFile(file, fn, options) {
|
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
async function withAudioFileSave(file, fn) {
|
|
15
|
-
return withAudioFile(file, (audioFile) => {
|
|
16
|
+
return withAudioFile(typeof file === "string" ? await readFileData(file) : file, (audioFile) => {
|
|
16
17
|
fn(audioFile);
|
|
17
18
|
if (!audioFile.save()) throw new FileOperationError("save", "Failed to save metadata changes. The file may be read-only or corrupted.");
|
|
18
19
|
return audioFile.getFileBuffer();
|