taglib-wasm 1.0.0-beta.9 → 1.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/LICENSE +1 -1
- package/README.md +49 -69
- package/dist/folder.d.ts +19 -0
- package/dist/folder.d.ts.map +1 -0
- package/dist/folder.js +2 -0
- package/dist/index.d.ts +25 -24
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -56
- package/dist/rating.d.ts +15 -0
- package/dist/rating.d.ts.map +1 -0
- package/dist/rating.js +2 -0
- package/dist/simple.d.ts +22 -0
- package/dist/simple.d.ts.map +1 -0
- package/dist/simple.js +2 -0
- package/dist/src/constants/basic-properties.d.ts +7 -7
- package/dist/src/constants/basic-properties.d.ts.map +1 -1
- package/dist/src/constants/basic-properties.js +7 -8
- package/dist/src/constants/complex-properties.d.ts +28 -1
- package/dist/src/constants/complex-properties.d.ts.map +1 -1
- package/dist/src/constants/complex-properties.js +11 -1
- package/dist/src/constants/general-extended-properties.d.ts +61 -22
- package/dist/src/constants/general-extended-properties.d.ts.map +1 -1
- package/dist/src/constants/general-extended-properties.js +55 -23
- package/dist/src/constants/index.d.ts +5 -5
- package/dist/src/constants/index.d.ts.map +1 -1
- package/dist/src/constants/index.js +1 -1
- package/dist/src/constants/properties.d.ts +89 -54
- package/dist/src/constants/properties.d.ts.map +1 -1
- package/dist/src/constants/properties.js +27 -1
- package/dist/src/constants/specialized-properties.d.ts +11 -11
- package/dist/src/constants/specialized-properties.js +11 -11
- package/dist/src/constants/tags.d.ts +82 -0
- package/dist/src/constants/tags.d.ts.map +1 -0
- package/dist/src/constants/tags.js +86 -0
- package/dist/src/constants/utilities.d.ts +2 -2
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/deno-compile.d.ts +3 -3
- package/dist/src/deno-compile.d.ts.map +1 -1
- package/dist/src/deno-compile.js +7 -3
- package/dist/src/errors/base.d.ts +3 -3
- package/dist/src/errors/base.d.ts.map +1 -1
- package/dist/src/errors/classes.d.ts +2 -23
- package/dist/src/errors/classes.d.ts.map +1 -1
- package/dist/src/errors/classes.js +4 -26
- package/dist/src/errors/guards.d.ts +2 -4
- package/dist/src/errors/guards.d.ts.map +1 -1
- package/dist/src/errors/guards.js +2 -12
- package/dist/src/errors/index.d.ts +4 -4
- package/dist/src/errors/index.d.ts.map +1 -1
- package/dist/src/errors/index.js +5 -11
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/file-utils/copy-and-find.d.ts.map +1 -1
- package/dist/src/file-utils/copy-and-find.js +1 -2
- package/dist/src/file-utils/export-operations.d.ts +2 -2
- package/dist/src/file-utils/export-operations.d.ts.map +1 -1
- package/dist/src/file-utils/export-operations.js +3 -5
- package/dist/src/file-utils/import-operations.d.ts +3 -3
- package/dist/src/file-utils/import-operations.d.ts.map +1 -1
- package/dist/src/file-utils/import-operations.js +4 -4
- package/dist/src/file-utils/index.d.ts +4 -4
- package/dist/src/file-utils/mime-detection.d.ts +1 -2
- package/dist/src/file-utils/mime-detection.d.ts.map +1 -1
- package/dist/src/file-utils/mime-detection.js +23 -22
- package/dist/src/folder-api/directory-walker.d.ts +1 -1
- package/dist/src/folder-api/directory-walker.d.ts.map +1 -1
- package/dist/src/folder-api/directory-walker.js +4 -43
- package/dist/src/folder-api/file-processors.d.ts +3 -7
- package/dist/src/folder-api/file-processors.d.ts.map +1 -1
- package/dist/src/folder-api/file-processors.js +12 -51
- package/dist/src/folder-api/folder-operations.d.ts +6 -12
- package/dist/src/folder-api/folder-operations.d.ts.map +1 -1
- package/dist/src/folder-api/folder-operations.js +48 -42
- package/dist/src/folder-api/index.d.ts +4 -4
- package/dist/src/folder-api/index.d.ts.map +1 -1
- package/dist/src/folder-api/scan-operations.d.ts +5 -5
- package/dist/src/folder-api/scan-operations.d.ts.map +1 -1
- package/dist/src/folder-api/scan-operations.js +17 -77
- package/dist/src/folder-api/types.d.ts +44 -39
- package/dist/src/folder-api/types.d.ts.map +1 -1
- package/dist/src/folder-api/types.js +5 -5
- package/dist/src/msgpack/decoder.d.ts +3 -3
- package/dist/src/msgpack/decoder.d.ts.map +1 -1
- package/dist/src/msgpack/decoder.js +54 -17
- package/dist/src/msgpack/encoder.d.ts +1 -1
- package/dist/src/msgpack/encoder.d.ts.map +1 -1
- package/dist/src/msgpack/encoder.js +38 -13
- package/dist/src/msgpack/index.d.ts +8 -8
- package/dist/src/msgpack/processor.d.ts +1 -1
- package/dist/src/msgpack/utils.d.ts +5 -5
- package/dist/src/msgpack/utils.d.ts.map +1 -1
- package/dist/src/msgpack/utils.js +9 -3
- package/dist/src/runtime/detector.d.ts +11 -0
- package/dist/src/runtime/detector.d.ts.map +1 -1
- package/dist/src/runtime/detector.js +54 -14
- package/dist/src/runtime/loader-types.d.ts +6 -6
- package/dist/src/runtime/loader-types.d.ts.map +1 -1
- package/dist/src/runtime/module-loader.d.ts +4 -4
- package/dist/src/runtime/module-loader.d.ts.map +1 -1
- package/dist/src/runtime/module-loader.js +16 -5
- package/dist/src/runtime/platform-io.d.ts +19 -0
- package/dist/src/runtime/platform-io.d.ts.map +1 -0
- package/dist/src/runtime/platform-io.js +188 -0
- package/dist/src/runtime/unified-loader/index.d.ts +4 -4
- package/dist/src/runtime/unified-loader/loader.d.ts +1 -1
- package/dist/src/runtime/unified-loader/module-loading.d.ts +3 -3
- package/dist/src/runtime/unified-loader/module-loading.d.ts.map +1 -1
- package/dist/src/runtime/unified-loader/module-loading.js +21 -6
- package/dist/src/runtime/unified-loader/module-selection.d.ts +2 -2
- package/dist/src/runtime/unified-loader/types.d.ts +6 -7
- package/dist/src/runtime/unified-loader/types.d.ts.map +1 -1
- package/dist/src/runtime/unified-loader/types.js +9 -11
- package/dist/src/runtime/wasi-adapter/adapter.d.ts +4 -4
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts +7 -7
- package/dist/src/runtime/wasi-adapter/file-handle.d.ts.map +1 -1
- package/dist/src/runtime/wasi-adapter/file-handle.js +121 -31
- package/dist/src/runtime/wasi-adapter/index.d.ts +1 -1
- package/dist/src/runtime/wasi-adapter/wasm-io.d.ts +2 -2
- package/dist/src/runtime/wasi-fs-deno.d.ts +1 -1
- package/dist/src/runtime/wasi-fs-node.d.ts +1 -1
- package/dist/src/runtime/wasi-host-loader.d.ts +5 -6
- package/dist/src/runtime/wasi-host-loader.d.ts.map +1 -1
- package/dist/src/runtime/wasi-host-loader.js +7 -7
- package/dist/src/runtime/wasi-host.d.ts +1 -1
- package/dist/src/runtime/wasi-host.d.ts.map +1 -1
- package/dist/src/runtime/wasi-host.js +2 -1
- package/dist/src/runtime/wasi-memory.d.ts +2 -1
- package/dist/src/runtime/wasi-memory.d.ts.map +1 -1
- package/dist/src/runtime/wasi-memory.js +5 -2
- package/dist/src/runtime/wasmer-sdk-loader/high-level-api.d.ts +1 -1
- package/dist/src/runtime/wasmer-sdk-loader/index.d.ts +5 -5
- package/dist/src/runtime/wasmer-sdk-loader/initialization.d.ts.map +1 -1
- package/dist/src/runtime/wasmer-sdk-loader/initialization.js +5 -2
- package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts +1 -1
- package/dist/src/runtime/wasmer-sdk-loader/loader.d.ts.map +1 -1
- package/dist/src/runtime/wasmer-sdk-loader/loader.js +4 -2
- package/dist/src/runtime/wasmer-sdk-loader/module-creation.d.ts +1 -1
- package/dist/src/runtime/wasmer-sdk-loader/types.d.ts +4 -6
- package/dist/src/runtime/wasmer-sdk-loader/types.d.ts.map +1 -1
- package/dist/src/runtime/wasmer-sdk-loader/types.js +13 -12
- package/dist/src/simple/batch-operations.d.ts +57 -25
- package/dist/src/simple/batch-operations.d.ts.map +1 -1
- package/dist/src/simple/batch-operations.js +56 -17
- package/dist/src/simple/config.d.ts +1 -9
- package/dist/src/simple/config.d.ts.map +1 -1
- package/dist/src/simple/config.js +2 -42
- package/dist/src/simple/index.d.ts +7 -8
- package/dist/src/simple/index.d.ts.map +1 -1
- package/dist/src/simple/index.js +7 -40
- package/dist/src/simple/picture-operations.d.ts +92 -11
- package/dist/src/simple/picture-operations.d.ts.map +1 -1
- package/dist/src/simple/picture-operations.js +5 -17
- package/dist/src/simple/tag-operations.d.ts +68 -12
- package/dist/src/simple/tag-operations.d.ts.map +1 -1
- package/dist/src/simple/tag-operations.js +34 -63
- package/dist/src/taglib/audio-file-base.d.ts +6 -4
- package/dist/src/taglib/audio-file-base.d.ts.map +1 -1
- package/dist/src/taglib/audio-file-base.js +37 -21
- package/dist/src/taglib/audio-file-impl.d.ts +6 -6
- package/dist/src/taglib/audio-file-impl.d.ts.map +1 -1
- package/dist/src/taglib/audio-file-impl.js +11 -15
- package/dist/src/taglib/audio-file-interface.d.ts +21 -46
- package/dist/src/taglib/audio-file-interface.d.ts.map +1 -1
- package/dist/src/taglib/index.d.ts +6 -6
- package/dist/src/taglib/load-audio-data.d.ts.map +1 -1
- package/dist/src/taglib/mutable-tag.d.ts +27 -9
- package/dist/src/taglib/mutable-tag.d.ts.map +1 -1
- package/dist/src/taglib/taglib-class.d.ts +48 -33
- package/dist/src/taglib/taglib-class.d.ts.map +1 -1
- package/dist/src/taglib/taglib-class.js +36 -71
- package/dist/src/taglib.d.ts +1 -1
- package/dist/src/types/audio-formats.d.ts +18 -16
- package/dist/src/types/audio-formats.d.ts.map +1 -1
- package/dist/src/types/config.d.ts +0 -28
- package/dist/src/types/config.d.ts.map +1 -1
- package/dist/src/types/format-property-keys.d.ts +16 -0
- package/dist/src/types/format-property-keys.d.ts.map +1 -0
- package/dist/src/types/index.d.ts +7 -6
- package/dist/src/types/index.d.ts.map +1 -1
- package/dist/src/types/index.js +1 -0
- package/dist/src/types/metadata-mappings.d.ts +2 -2
- package/dist/src/types/metadata-mappings.d.ts.map +1 -1
- package/dist/src/types/metadata-mappings.js +25 -0
- package/dist/src/types/pictures.d.ts +4 -4
- package/dist/src/types/pictures.d.ts.map +1 -1
- package/dist/src/types/tags.d.ts +119 -39
- package/dist/src/types/tags.d.ts.map +1 -1
- package/dist/src/types.d.ts +1 -1
- package/dist/src/utils/file.d.ts.map +1 -1
- package/dist/src/utils/file.js +17 -123
- package/dist/src/utils/path.d.ts +14 -0
- package/dist/src/utils/path.d.ts.map +1 -0
- package/dist/src/utils/path.js +17 -0
- package/dist/src/utils/rating.d.ts +33 -19
- package/dist/src/utils/rating.d.ts.map +1 -1
- package/dist/src/utils/rating.js +27 -17
- package/dist/src/utils/tag-mapping.d.ts +6 -0
- package/dist/src/utils/tag-mapping.d.ts.map +1 -0
- package/dist/src/utils/tag-mapping.js +101 -0
- package/dist/src/utils/write.d.ts +0 -9
- package/dist/src/utils/write.d.ts.map +1 -1
- package/dist/src/utils/write.js +3 -28
- package/dist/src/wasm.d.ts +11 -5
- package/dist/src/wasm.d.ts.map +1 -1
- package/dist/src/web-utils/canvas.d.ts +2 -2
- package/dist/src/web-utils/canvas.d.ts.map +1 -1
- package/dist/src/web-utils/canvas.js +9 -11
- package/dist/src/web-utils/data-url.d.ts +3 -3
- package/dist/src/web-utils/data-url.d.ts.map +1 -1
- package/dist/src/web-utils/data-url.js +7 -4
- package/dist/src/web-utils/dom-integration.d.ts +2 -2
- package/dist/src/web-utils/index.d.ts +5 -5
- package/dist/taglib-web.wasm +0 -0
- package/dist/taglib-wrapper.js +1 -1
- package/dist/web.d.ts +18 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +2 -0
- package/package.json +55 -16
- package/dist/src/constants/legacy-tags.d.ts +0 -79
- package/dist/src/constants/legacy-tags.d.ts.map +0 -1
- package/dist/src/constants/legacy-tags.js +0 -80
- package/dist/src/mod.d.ts +0 -10
- package/dist/src/mod.d.ts.map +0 -1
- package/dist/src/mod.js +0 -15
- package/dist/src/runtime/length-prefix-protocol.d.ts +0 -34
- package/dist/src/runtime/length-prefix-protocol.d.ts.map +0 -1
- package/dist/src/runtime/length-prefix-protocol.js +0 -49
- package/dist/src/runtime/wasmtime-sidecar.d.ts +0 -53
- package/dist/src/runtime/wasmtime-sidecar.d.ts.map +0 -1
- package/dist/src/runtime/wasmtime-sidecar.js +0 -182
- package/dist/src/simple/field-constants.d.ts +0 -11
- package/dist/src/simple/field-constants.d.ts.map +0 -1
- package/dist/src/simple/field-constants.js +0 -22
- package/dist/src/taglib/audio-file-extended.d.ts +0 -28
- package/dist/src/taglib/audio-file-extended.d.ts.map +0 -1
- package/dist/src/taglib/audio-file-extended.js +0 -73
- package/dist/src/wasm-workers.d.ts +0 -44
- package/dist/src/wasm-workers.d.ts.map +0 -1
- package/dist/src/wasm-workers.js +0 -127
- package/dist/src/worker-pool/global-pool.d.ts +0 -21
- package/dist/src/worker-pool/global-pool.d.ts.map +0 -1
- package/dist/src/worker-pool/global-pool.js +0 -22
- package/dist/src/worker-pool/index.d.ts +0 -10
- package/dist/src/worker-pool/index.d.ts.map +0 -1
- package/dist/src/worker-pool/index.js +0 -12
- package/dist/src/worker-pool/pool-initialization.d.ts +0 -7
- package/dist/src/worker-pool/pool-initialization.d.ts.map +0 -1
- package/dist/src/worker-pool/pool-initialization.js +0 -67
- package/dist/src/worker-pool/pool.d.ts +0 -39
- package/dist/src/worker-pool/pool.d.ts.map +0 -1
- package/dist/src/worker-pool/pool.js +0 -173
- package/dist/src/worker-pool/types.d.ts +0 -72
- package/dist/src/worker-pool/types.d.ts.map +0 -1
- package/dist/src/workers/audio-file-workers.d.ts +0 -85
- package/dist/src/workers/audio-file-workers.d.ts.map +0 -1
- package/dist/src/workers/audio-file-workers.js +0 -252
- package/dist/src/workers/batch-handler.d.ts +0 -17
- package/dist/src/workers/batch-handler.d.ts.map +0 -1
- package/dist/src/workers/batch-handler.js +0 -82
- package/dist/src/workers/index.d.ts +0 -12
- package/dist/src/workers/index.d.ts.map +0 -1
- package/dist/src/workers/index.js +0 -7
- package/dist/src/workers/taglib-worker.d.ts +0 -2
- package/dist/src/workers/taglib-worker.d.ts.map +0 -1
- package/dist/src/workers/taglib-worker.js +0 -116
- package/dist/src/workers/taglib-workers.d.ts +0 -95
- package/dist/src/workers/taglib-workers.d.ts.map +0 -1
- package/dist/src/workers/taglib-workers.js +0 -173
- /package/dist/src/{worker-pool/types.js → types/format-property-keys.js} +0 -0
package/LICENSE
CHANGED
|
@@ -44,4 +44,4 @@ To rebuild the WebAssembly binary with a modified TagLib:
|
|
|
44
44
|
3. The new binary will be in build/taglib.wasm
|
|
45
45
|
|
|
46
46
|
For more information about LGPL compliance and dual licensing, see:
|
|
47
|
-
https://github.com/CharlesWiltgen/
|
|
47
|
+
https://github.com/CharlesWiltgen/TagLib-Wasm#licensing
|
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# TagLib-Wasm
|
|
2
2
|
|
|
3
|
-
[](https://github.com/CharlesWiltgen/TagLib-Wasm/actions/workflows/test.yml)
|
|
4
4
|
[](https://www.npmjs.com/package/taglib-wasm)
|
|
5
5
|
[](https://www.npmjs.com/package/taglib-wasm)
|
|
6
|
-
[](https://github.com/CharlesWiltgen/
|
|
6
|
+
[](https://github.com/CharlesWiltgen/TagLib-Wasm/blob/main/LICENSE)
|
|
7
7
|
<br>[](https://www.typescriptlang.org/)
|
|
8
8
|
[](https://emscripten.org/)
|
|
9
9
|
[](https://webassembly.org/)
|
|
@@ -52,9 +52,10 @@ import { TagLib } from "@charlesw/taglib-wasm";
|
|
|
52
52
|
npm install taglib-wasm
|
|
53
53
|
```
|
|
54
54
|
|
|
55
|
-
> **Note:** Requires Node.js v22.6.0 or higher
|
|
56
|
-
>
|
|
57
|
-
>
|
|
55
|
+
> **Note:** Requires Node.js v22.6.0 or higher (for WebAssembly exception
|
|
56
|
+
> handling and `import.meta.url` support). If you want to use the TypeScript
|
|
57
|
+
> version with Node.js, see the
|
|
58
|
+
> [installation guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/installation.html).
|
|
58
59
|
|
|
59
60
|
### Bun
|
|
60
61
|
|
|
@@ -98,7 +99,7 @@ const taglib = await initializeForDenoCompile();
|
|
|
98
99
|
```
|
|
99
100
|
|
|
100
101
|
See the
|
|
101
|
-
[complete Deno compile guide](https://charleswiltgen.github.io/
|
|
102
|
+
[complete Deno compile guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/deno-compile.html)
|
|
102
103
|
for more options including CDN loading.
|
|
103
104
|
|
|
104
105
|
For manual control:
|
|
@@ -119,11 +120,11 @@ const taglib = await TagLib.initialize({ wasmBinary });
|
|
|
119
120
|
### Simple API
|
|
120
121
|
|
|
121
122
|
```typescript
|
|
122
|
-
import { applyTags,
|
|
123
|
+
import { applyTags, applyTagsToFile, readTags } from "taglib-wasm/simple";
|
|
123
124
|
|
|
124
|
-
// Read tags
|
|
125
|
+
// Read tags (string fields are arrays to support multi-value metadata)
|
|
125
126
|
const tags = await readTags("song.mp3");
|
|
126
|
-
console.log(tags.title, tags.artist, tags.album);
|
|
127
|
+
console.log(tags.title?.[0], tags.artist?.[0], tags.album?.[0]);
|
|
127
128
|
|
|
128
129
|
// Apply tags and get modified buffer (in-memory)
|
|
129
130
|
const modifiedBuffer = await applyTags("song.mp3", {
|
|
@@ -133,7 +134,7 @@ const modifiedBuffer = await applyTags("song.mp3", {
|
|
|
133
134
|
});
|
|
134
135
|
|
|
135
136
|
// Or update tags on disk (requires file path)
|
|
136
|
-
await
|
|
137
|
+
await applyTagsToFile("song.mp3", {
|
|
137
138
|
title: "New Title",
|
|
138
139
|
artist: "New Artist",
|
|
139
140
|
});
|
|
@@ -191,18 +192,23 @@ import { findDuplicates, scanFolder } from "taglib-wasm";
|
|
|
191
192
|
// Scan a music library
|
|
192
193
|
const result = await scanFolder("/path/to/music", {
|
|
193
194
|
recursive: true,
|
|
194
|
-
concurrency: 4,
|
|
195
195
|
onProgress: (processed, total, file) => {
|
|
196
196
|
console.log(`Processing ${processed}/${total}: ${file}`);
|
|
197
197
|
},
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
-
console.log(`Found ${result.
|
|
201
|
-
console.log(
|
|
200
|
+
console.log(`Found ${result.items.length} audio files`);
|
|
201
|
+
console.log(
|
|
202
|
+
`Successfully processed ${
|
|
203
|
+
result.items.filter((i) => i.status === "ok").length
|
|
204
|
+
} files`,
|
|
205
|
+
);
|
|
202
206
|
|
|
203
207
|
// Process results
|
|
204
|
-
for (const file of result.
|
|
205
|
-
console.log(
|
|
208
|
+
for (const file of result.items) {
|
|
209
|
+
console.log(
|
|
210
|
+
`${file.path}: ${file.tags.artist?.[0]} - ${file.tags.title?.[0]}`,
|
|
211
|
+
);
|
|
206
212
|
console.log(`Duration: ${file.properties?.duration}s`);
|
|
207
213
|
}
|
|
208
214
|
|
|
@@ -249,7 +255,7 @@ file.setRating(0.8);
|
|
|
249
255
|
file.save();
|
|
250
256
|
```
|
|
251
257
|
|
|
252
|
-
See the [Track Ratings Guide](https://charleswiltgen.github.io/
|
|
258
|
+
See the [Track Ratings Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/ratings.html)
|
|
253
259
|
for RatingUtils API and cross-format conversion details.
|
|
254
260
|
|
|
255
261
|
### Container Format and Codec Detection
|
|
@@ -266,7 +272,7 @@ console.log(props.isLossless); // false for AAC, true for ALAC
|
|
|
266
272
|
console.log(props.bitsPerSample); // 16 for most formats
|
|
267
273
|
console.log(props.bitrate); // 256 (kbps)
|
|
268
274
|
console.log(props.sampleRate); // 44100 (Hz)
|
|
269
|
-
console.log(props.
|
|
275
|
+
console.log(props.duration); // 180 (duration in seconds)
|
|
270
276
|
```
|
|
271
277
|
|
|
272
278
|
Container format vs Codec:
|
|
@@ -285,26 +291,26 @@ Supported formats:
|
|
|
285
291
|
|
|
286
292
|
## Documentation
|
|
287
293
|
|
|
288
|
-
**[View Full Documentation](https://charleswiltgen.github.io/
|
|
294
|
+
**[View Full Documentation](https://charleswiltgen.github.io/TagLib-Wasm/)**
|
|
289
295
|
|
|
290
296
|
### Getting Started
|
|
291
297
|
|
|
292
|
-
- [Installation Guide](https://charleswiltgen.github.io/
|
|
293
|
-
- [Quick Start Tutorial](https://charleswiltgen.github.io/
|
|
294
|
-
- [All Examples](https://charleswiltgen.github.io/
|
|
298
|
+
- [Installation Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/installation.html)
|
|
299
|
+
- [Quick Start Tutorial](https://charleswiltgen.github.io/TagLib-Wasm/guide/quick-start.html)
|
|
300
|
+
- [All Examples](https://charleswiltgen.github.io/TagLib-Wasm/guide/examples.html)
|
|
295
301
|
|
|
296
302
|
### Guides
|
|
297
303
|
|
|
298
|
-
- [API Reference](https://charleswiltgen.github.io/
|
|
299
|
-
- [Performance Guide](https://charleswiltgen.github.io/
|
|
300
|
-
- [Album Processing Guide](https://charleswiltgen.github.io/
|
|
301
|
-
- [Platform Examples](https://charleswiltgen.github.io/
|
|
302
|
-
- [Working with Cover Art](https://charleswiltgen.github.io/
|
|
303
|
-
- [Track Ratings](https://charleswiltgen.github.io/
|
|
304
|
-
- [Cloudflare Workers
|
|
305
|
-
- [Error Handling](https://charleswiltgen.github.io/
|
|
306
|
-
|
|
304
|
+
- [API Reference](https://charleswiltgen.github.io/TagLib-Wasm/api/)
|
|
305
|
+
- [Performance Guide](https://charleswiltgen.github.io/TagLib-Wasm/concepts/performance.html)
|
|
306
|
+
- [Album Processing Guide](https://charleswiltgen.github.io/TagLib-Wasm/guide/album-processing.html)
|
|
307
|
+
- [Platform Examples](https://charleswiltgen.github.io/TagLib-Wasm/guide/platform-examples.html)
|
|
308
|
+
- [Working with Cover Art](https://charleswiltgen.github.io/TagLib-Wasm/guide/cover-art.html)
|
|
309
|
+
- [Track Ratings](https://charleswiltgen.github.io/TagLib-Wasm/guide/ratings.html)
|
|
310
|
+
- [Cloudflare Workers](https://charleswiltgen.github.io/TagLib-Wasm/advanced/cloudflare-workers.html)
|
|
311
|
+
- [Error Handling](https://charleswiltgen.github.io/TagLib-Wasm/concepts/error-handling.html)
|
|
307
312
|
- [Contributing](CONTRIBUTING.md)
|
|
313
|
+
- [AI Agent Documentation](AGENTS.md)
|
|
308
314
|
|
|
309
315
|
## Supported Formats
|
|
310
316
|
|
|
@@ -380,49 +386,25 @@ await file.saveToFile(); // Full file loaded only here
|
|
|
380
386
|
|
|
381
387
|
taglib-wasm auto-selects the fastest available backend — no configuration needed:
|
|
382
388
|
|
|
383
|
-
| Environment | Backend | How it works | Performance
|
|
384
|
-
| ------------------------ | ----------------- | ------------------------------------------------------ |
|
|
385
|
-
| **Deno / Node.js / Bun** | WASI (auto) | Seek-based filesystem I/O; reads only headers and tags | Fastest
|
|
386
|
-
| **Browsers / Workers** | Emscripten (auto) | Entire file loaded into memory as buffer | Baseline
|
|
387
|
-
| **Opt-in** | Wasmtime sidecar | Out-of-process WASI with direct filesystem access | Best for batch |
|
|
389
|
+
| Environment | Backend | How it works | Performance |
|
|
390
|
+
| ------------------------ | ----------------- | ------------------------------------------------------ | ----------- |
|
|
391
|
+
| **Deno / Node.js / Bun** | WASI (auto) | Seek-based filesystem I/O; reads only headers and tags | Fastest |
|
|
392
|
+
| **Browsers / Workers** | Emscripten (auto) | Entire file loaded into memory as buffer | Baseline |
|
|
388
393
|
|
|
389
|
-
On Deno, Node.js, and Bun you get WASI automatically — nothing to configure.
|
|
390
|
-
heavy batch workloads, the optional Wasmtime sidecar provides direct filesystem
|
|
391
|
-
access via a sandboxed subprocess:
|
|
392
|
-
|
|
393
|
-
```bash
|
|
394
|
-
# Optional: Install Wasmtime for sidecar mode
|
|
395
|
-
curl https://wasmtime.dev/install.sh -sSf | bash
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
```typescript
|
|
399
|
-
import { readTags, setSidecarConfig } from "taglib-wasm/simple";
|
|
400
|
-
|
|
401
|
-
// Enable sidecar mode (requires Wasmtime)
|
|
402
|
-
await setSidecarConfig({
|
|
403
|
-
preopens: { "/music": "/home/user/Music" },
|
|
404
|
-
});
|
|
405
|
-
|
|
406
|
-
// Now path-based calls use direct WASI filesystem access
|
|
407
|
-
const tags = await readTags("/music/song.mp3");
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
See the
|
|
411
|
-
[Runtime Compatibility Guide](https://charleswiltgen.github.io/taglib-wasm/concepts/runtime-compatibility.html)
|
|
412
|
-
for full sidecar configuration options.
|
|
394
|
+
On Deno, Node.js, and Bun you get WASI automatically — nothing to configure.
|
|
413
395
|
|
|
414
396
|
## Runtime Compatibility
|
|
415
397
|
|
|
416
398
|
`taglib-wasm` works across all major JavaScript runtimes:
|
|
417
399
|
|
|
418
|
-
| Runtime | Status | Installation | Notes
|
|
419
|
-
| ---------------------- | ------- | ------------------------- |
|
|
420
|
-
| **Deno** | Full | `npm:taglib-wasm` | Native TypeScript
|
|
421
|
-
| **Node.js** | Full | `npm install taglib-wasm` | TypeScript via tsx
|
|
422
|
-
| **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; full test suite is Deno-only
|
|
423
|
-
| **Browser** | Full | Via bundler | Full API support
|
|
424
|
-
| **Cloudflare Workers** |
|
|
425
|
-
| **Electron** | Node.js | `npm install taglib-wasm` | Main process; renderer via IPC
|
|
400
|
+
| Runtime | Status | Installation | Notes |
|
|
401
|
+
| ---------------------- | ------- | ------------------------- | -------------------------------------------------------------------------- |
|
|
402
|
+
| **Deno** | Full | `npm:taglib-wasm` | Native TypeScript |
|
|
403
|
+
| **Node.js** | Full | `npm install taglib-wasm` | TypeScript via tsx |
|
|
404
|
+
| **Bun** | Partial | `bun add taglib-wasm` | Import + init verified; full test suite is Deno-only |
|
|
405
|
+
| **Browser** | Full | Via bundler | Full API support |
|
|
406
|
+
| **Cloudflare Workers** | Full | `npm install taglib-wasm` | Same unified API; see [Workers guide](docs/advanced/cloudflare-workers.md) |
|
|
407
|
+
| **Electron** | Node.js | `npm install taglib-wasm` | Main process; renderer via IPC |
|
|
426
408
|
|
|
427
409
|
## Known Limitations
|
|
428
410
|
|
|
@@ -430,8 +412,6 @@ for full sidecar configuration options.
|
|
|
430
412
|
into memory. On Deno/Node.js, WASI reads only headers and tags from disk.
|
|
431
413
|
- **Concurrent Access** – Not thread-safe (JavaScript single-threaded nature
|
|
432
414
|
mitigates this)
|
|
433
|
-
- **Cloudflare Workers** – Limited to 128MB memory per request; files larger
|
|
434
|
-
than ~100MB may fail
|
|
435
415
|
|
|
436
416
|
## Contributing
|
|
437
417
|
|
package/dist/folder.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Folder scanning and batch operations for audio file collections.
|
|
3
|
+
*
|
|
4
|
+
* @module folder
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { scanFolder, findDuplicates } from "@charlesw/taglib-wasm/folder";
|
|
9
|
+
*
|
|
10
|
+
* const result = await scanFolder("/path/to/music");
|
|
11
|
+
* for (const item of result.items) {
|
|
12
|
+
* if (item.status === "ok") {
|
|
13
|
+
* console.log(`${item.path}: ${item.tags.artist} - ${item.tags.title}`);
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export * from "./src/folder-api/index.js";
|
|
19
|
+
//# sourceMappingURL=folder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"folder.d.ts","sourceRoot":"","sources":["../folder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc,2BAA2B,CAAC"}
|
package/dist/folder.js
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @fileoverview Main module exports for
|
|
2
|
+
* @fileoverview Main module exports for TagLib-Wasm
|
|
3
3
|
*
|
|
4
4
|
* TagLib v2.1 compiled to WebAssembly with TypeScript bindings
|
|
5
5
|
* for universal audio metadata handling across all JavaScript runtimes.
|
|
6
6
|
*
|
|
7
|
-
* @module
|
|
7
|
+
* @module TagLib-Wasm
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
@@ -32,26 +32,27 @@
|
|
|
32
32
|
* });
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export {
|
|
36
|
-
export
|
|
37
|
-
export {
|
|
38
|
-
export
|
|
39
|
-
export {
|
|
40
|
-
export {
|
|
41
|
-
export {
|
|
42
|
-
export
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
export {
|
|
46
|
-
export
|
|
47
|
-
export {
|
|
48
|
-
export
|
|
49
|
-
export {
|
|
50
|
-
export type {
|
|
51
|
-
export {
|
|
52
|
-
export {
|
|
53
|
-
export
|
|
54
|
-
export type {
|
|
55
|
-
export type {
|
|
56
|
-
export {
|
|
35
|
+
export type { AudioFile, TypedAudioFile, } from "./src/taglib/audio-file-interface.js";
|
|
36
|
+
export { AudioFileImpl, createTagLib, TagLib } from "./src/taglib.js";
|
|
37
|
+
export type { MutableTag } from "./src/taglib.js";
|
|
38
|
+
export { EnvironmentError, FileOperationError, InvalidFormatError, isEnvironmentError, isFileOperationError, isInvalidFormatError, isMemoryError, isMetadataError, isTagLibError, isUnsupportedFormatError, MemoryError, MetadataError, SUPPORTED_FORMATS, TagLibError, TagLibInitializationError, UnsupportedFormatError, } from "./src/errors.js";
|
|
39
|
+
export type { TagLibErrorCode } from "./src/errors.js";
|
|
40
|
+
export { initializeForDenoCompile, isDenoCompiled, prepareWasmForEmbedding, } from "./src/deno-compile.js";
|
|
41
|
+
export { addPicture, applyCoverArt, applyPictures, applyTags, applyTagsToFile, type BatchItem, type BatchOptions, type BatchResult, clearPictures, clearTags, type FileMetadata, findPictureByType, isValidAudioFile, readCoverArt, readFormat, readMetadata, readMetadataBatch, readPictureMetadata, readPictures, readProperties, readPropertiesBatch, readTags, readTagsBatch, replacePictureByType, setBufferMode, } from "./src/simple/index.js";
|
|
42
|
+
export { FormatMappings, getAllProperties, getAllPropertyKeys, getAllTagNames, getPropertiesByFormat, getPropertyMetadata, isValidProperty, isValidTagName, PROPERTIES, Tags, } from "./src/constants.js";
|
|
43
|
+
export type { PropertyMetadata } from "./src/constants/property-types.js";
|
|
44
|
+
export { copyCoverArt, exportAllPictures, exportCoverArt, exportPictureByType, findCoverArtFiles, importCoverArt, importPictureWithType, loadPictureFromFile, savePictureToFile, } from "./src/file-utils/index.js";
|
|
45
|
+
export { type AudioDynamics, type AudioFileMetadata, type DuplicateGroup, exportFolderMetadata, findDuplicates, type FolderScanItem, type FolderScanOptions, type FolderScanResult, type FolderUpdateItem, type FolderUpdateResult, scanFolder, updateFolderTags, } from "./src/folder-api/index.js";
|
|
46
|
+
export { canvasToPicture, createPictureDownloadURL, createPictureGallery, dataURLToPicture, displayPicture, imageFileToPicture, pictureToDataURL, setCoverArtFromCanvas, } from "./src/web-utils/index.js";
|
|
47
|
+
export type { AudioCodec, AudioFileInput, AudioProperties, BitrateControlMode, ContainerFormat, ExtendedTag, FieldMapping, FileType, OpenOptions, Picture, PictureType, PropertyMap, Tag, TagInput, TagName, } from "./src/types.js";
|
|
48
|
+
export { BITRATE_CONTROL_MODE_NAMES, BITRATE_CONTROL_MODE_VALUES, PICTURE_TYPE_NAMES, PICTURE_TYPE_VALUES, } from "./src/types.js";
|
|
49
|
+
export type { PropertyKey, PropertyValue } from "./src/constants.js";
|
|
50
|
+
export type { FormatPropertyKey, TagFormat, } from "./src/types/format-property-keys.js";
|
|
51
|
+
export { COMPLEX_PROPERTIES, COMPLEX_PROPERTY_KEY, } from "./src/constants/complex-properties.js";
|
|
52
|
+
export type { ComplexPropertyKey, ComplexPropertyKeyMap, ComplexPropertyValueMap, Rating, UnsyncedLyrics, VariantMap, } from "./src/constants/complex-properties.js";
|
|
53
|
+
export { RatingUtils } from "./src/utils/rating.js";
|
|
54
|
+
export type { NormalizedRating, PopmRating } from "./src/utils/rating.js";
|
|
55
|
+
export type { TagLibModule, WasmModule } from "./src/wasm.js";
|
|
56
|
+
export type { LoadTagLibOptions } from "./src/runtime/loader-types.js";
|
|
57
|
+
export { loadTagLibModule } from "./src/runtime/module-loader.js";
|
|
57
58
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// index.ts
|
|
2
|
-
import { AudioFileImpl, TagLib } from "./src/taglib.js";
|
|
2
|
+
import { AudioFileImpl, createTagLib, TagLib } from "./src/taglib.js";
|
|
3
3
|
import {
|
|
4
4
|
EnvironmentError,
|
|
5
5
|
FileOperationError,
|
|
@@ -9,18 +9,14 @@ import {
|
|
|
9
9
|
isInvalidFormatError,
|
|
10
10
|
isMemoryError,
|
|
11
11
|
isMetadataError,
|
|
12
|
-
isSidecarError,
|
|
13
12
|
isTagLibError,
|
|
14
13
|
isUnsupportedFormatError,
|
|
15
|
-
isWorkerError,
|
|
16
14
|
MemoryError,
|
|
17
15
|
MetadataError,
|
|
18
|
-
SidecarError,
|
|
19
16
|
SUPPORTED_FORMATS,
|
|
20
17
|
TagLibError,
|
|
21
18
|
TagLibInitializationError,
|
|
22
|
-
UnsupportedFormatError
|
|
23
|
-
WorkerError
|
|
19
|
+
UnsupportedFormatError
|
|
24
20
|
} from "./src/errors.js";
|
|
25
21
|
import {
|
|
26
22
|
initializeForDenoCompile,
|
|
@@ -32,13 +28,14 @@ import {
|
|
|
32
28
|
applyCoverArt,
|
|
33
29
|
applyPictures,
|
|
34
30
|
applyTags,
|
|
35
|
-
|
|
31
|
+
applyTagsToFile,
|
|
36
32
|
clearPictures,
|
|
37
33
|
clearTags,
|
|
38
34
|
findPictureByType,
|
|
39
35
|
isValidAudioFile,
|
|
40
36
|
readCoverArt,
|
|
41
37
|
readFormat,
|
|
38
|
+
readMetadata,
|
|
42
39
|
readMetadataBatch,
|
|
43
40
|
readPictureMetadata,
|
|
44
41
|
readPictures,
|
|
@@ -47,11 +44,7 @@ import {
|
|
|
47
44
|
readTags,
|
|
48
45
|
readTagsBatch,
|
|
49
46
|
replacePictureByType,
|
|
50
|
-
setBufferMode
|
|
51
|
-
setSidecarConfig,
|
|
52
|
-
setWorkerPoolMode,
|
|
53
|
-
updateTags,
|
|
54
|
-
writeTagsToFile
|
|
47
|
+
setBufferMode
|
|
55
48
|
} from "./src/simple/index.js";
|
|
56
49
|
import {
|
|
57
50
|
FormatMappings,
|
|
@@ -102,28 +95,10 @@ import {
|
|
|
102
95
|
COMPLEX_PROPERTIES,
|
|
103
96
|
COMPLEX_PROPERTY_KEY
|
|
104
97
|
} from "./src/constants/complex-properties.js";
|
|
105
|
-
import {
|
|
106
|
-
clamp,
|
|
107
|
-
fromNormalized,
|
|
108
|
-
fromPercent,
|
|
109
|
-
fromPopm,
|
|
110
|
-
fromStars,
|
|
111
|
-
isValid,
|
|
112
|
-
RatingUtils,
|
|
113
|
-
toNormalized,
|
|
114
|
-
toPercent,
|
|
115
|
-
toPopm,
|
|
116
|
-
toStars
|
|
117
|
-
} from "./src/utils/rating.js";
|
|
118
|
-
import {
|
|
119
|
-
createWorkerPool,
|
|
120
|
-
getGlobalWorkerPool,
|
|
121
|
-
TagLibWorkerPool,
|
|
122
|
-
terminateGlobalWorkerPool
|
|
123
|
-
} from "./src/worker-pool/index.js";
|
|
98
|
+
import { RatingUtils } from "./src/utils/rating.js";
|
|
124
99
|
import { loadTagLibModule } from "./src/runtime/module-loader.js";
|
|
125
100
|
export {
|
|
126
|
-
AudioFileImpl
|
|
101
|
+
AudioFileImpl,
|
|
127
102
|
BITRATE_CONTROL_MODE_NAMES,
|
|
128
103
|
BITRATE_CONTROL_MODE_VALUES,
|
|
129
104
|
COMPLEX_PROPERTIES,
|
|
@@ -139,27 +114,23 @@ export {
|
|
|
139
114
|
PROPERTIES,
|
|
140
115
|
RatingUtils,
|
|
141
116
|
SUPPORTED_FORMATS,
|
|
142
|
-
SidecarError,
|
|
143
117
|
TagLib,
|
|
144
118
|
TagLibError,
|
|
145
119
|
TagLibInitializationError,
|
|
146
|
-
TagLibWorkerPool,
|
|
147
120
|
Tags,
|
|
148
121
|
UnsupportedFormatError,
|
|
149
|
-
WorkerError,
|
|
150
122
|
addPicture,
|
|
151
123
|
applyCoverArt,
|
|
152
124
|
applyPictures,
|
|
153
125
|
applyTags,
|
|
154
|
-
|
|
126
|
+
applyTagsToFile,
|
|
155
127
|
canvasToPicture,
|
|
156
|
-
clamp as clampRating,
|
|
157
128
|
clearPictures,
|
|
158
129
|
clearTags,
|
|
159
130
|
copyCoverArt,
|
|
160
131
|
createPictureDownloadURL,
|
|
161
132
|
createPictureGallery,
|
|
162
|
-
|
|
133
|
+
createTagLib,
|
|
163
134
|
dataURLToPicture,
|
|
164
135
|
displayPicture,
|
|
165
136
|
exportAllPictures,
|
|
@@ -169,14 +140,9 @@ export {
|
|
|
169
140
|
findCoverArtFiles,
|
|
170
141
|
findDuplicates,
|
|
171
142
|
findPictureByType,
|
|
172
|
-
fromNormalized,
|
|
173
|
-
fromPercent,
|
|
174
|
-
fromPopm,
|
|
175
|
-
fromStars,
|
|
176
143
|
getAllProperties,
|
|
177
144
|
getAllPropertyKeys,
|
|
178
145
|
getAllTagNames,
|
|
179
|
-
getGlobalWorkerPool,
|
|
180
146
|
getPropertiesByFormat,
|
|
181
147
|
getPropertyMetadata,
|
|
182
148
|
imageFileToPicture,
|
|
@@ -189,20 +155,18 @@ export {
|
|
|
189
155
|
isInvalidFormatError,
|
|
190
156
|
isMemoryError,
|
|
191
157
|
isMetadataError,
|
|
192
|
-
isSidecarError,
|
|
193
158
|
isTagLibError,
|
|
194
159
|
isUnsupportedFormatError,
|
|
195
160
|
isValidAudioFile,
|
|
196
161
|
isValidProperty,
|
|
197
|
-
isValid as isValidRating,
|
|
198
162
|
isValidTagName,
|
|
199
|
-
isWorkerError,
|
|
200
163
|
loadPictureFromFile,
|
|
201
164
|
loadTagLibModule,
|
|
202
165
|
pictureToDataURL,
|
|
203
166
|
prepareWasmForEmbedding,
|
|
204
167
|
readCoverArt,
|
|
205
168
|
readFormat,
|
|
169
|
+
readMetadata,
|
|
206
170
|
readMetadataBatch,
|
|
207
171
|
readPictureMetadata,
|
|
208
172
|
readPictures,
|
|
@@ -215,14 +179,5 @@ export {
|
|
|
215
179
|
scanFolder,
|
|
216
180
|
setBufferMode,
|
|
217
181
|
setCoverArtFromCanvas,
|
|
218
|
-
|
|
219
|
-
setWorkerPoolMode,
|
|
220
|
-
terminateGlobalWorkerPool,
|
|
221
|
-
toNormalized,
|
|
222
|
-
toPercent,
|
|
223
|
-
toPopm,
|
|
224
|
-
toStars,
|
|
225
|
-
updateFolderTags,
|
|
226
|
-
updateTags,
|
|
227
|
-
writeTagsToFile
|
|
182
|
+
updateFolderTags
|
|
228
183
|
};
|
package/dist/rating.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rating conversion utilities for cross-format compatibility.
|
|
3
|
+
*
|
|
4
|
+
* @module rating
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { toStars, fromStars, toPopm } from "@charlesw/taglib-wasm/rating";
|
|
9
|
+
*
|
|
10
|
+
* const normalized = fromStars(4, 5); // 0.8
|
|
11
|
+
* const popm = toPopm(0.8); // 196
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export * from "./src/utils/rating.js";
|
|
15
|
+
//# sourceMappingURL=rating.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../rating.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,cAAc,uBAAuB,CAAC"}
|
package/dist/rating.js
ADDED
package/dist/simple.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple API for reading and writing audio metadata with minimal code.
|
|
3
|
+
*
|
|
4
|
+
* @module simple
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { readTags, applyTags } from "@charlesw/taglib-wasm/simple";
|
|
9
|
+
*
|
|
10
|
+
* // Read tags from a file
|
|
11
|
+
* const tags = await readTags(audioBuffer);
|
|
12
|
+
* console.log(tags.title, tags.artist);
|
|
13
|
+
*
|
|
14
|
+
* // Apply tags and get modified buffer
|
|
15
|
+
* const modified = await applyTags(audioBuffer, {
|
|
16
|
+
* title: "New Title",
|
|
17
|
+
* artist: "New Artist"
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export * from "./src/simple/index.js";
|
|
22
|
+
//# sourceMappingURL=simple.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../simple.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,cAAc,uBAAuB,CAAC"}
|
package/dist/simple.js
ADDED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* These are the core tags that most audio files should have.
|
|
4
4
|
*/
|
|
5
5
|
export declare const BASIC_PROPERTIES: {
|
|
6
|
-
readonly
|
|
6
|
+
readonly title: {
|
|
7
7
|
readonly key: "TITLE";
|
|
8
8
|
readonly description: "The title of the track";
|
|
9
9
|
readonly type: "string";
|
|
@@ -17,7 +17,7 @@ export declare const BASIC_PROPERTIES: {
|
|
|
17
17
|
readonly wav: "INAM";
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
readonly
|
|
20
|
+
readonly artist: {
|
|
21
21
|
readonly key: "ARTIST";
|
|
22
22
|
readonly description: "The primary performer(s) of the track";
|
|
23
23
|
readonly type: "string";
|
|
@@ -31,7 +31,7 @@ export declare const BASIC_PROPERTIES: {
|
|
|
31
31
|
readonly wav: "IART";
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
|
-
readonly
|
|
34
|
+
readonly album: {
|
|
35
35
|
readonly key: "ALBUM";
|
|
36
36
|
readonly description: "The album/collection name";
|
|
37
37
|
readonly type: "string";
|
|
@@ -45,7 +45,7 @@ export declare const BASIC_PROPERTIES: {
|
|
|
45
45
|
readonly wav: "IPRD";
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
readonly
|
|
48
|
+
readonly date: {
|
|
49
49
|
readonly key: "DATE";
|
|
50
50
|
readonly description: "The date of recording (typically year)";
|
|
51
51
|
readonly type: "string";
|
|
@@ -59,7 +59,7 @@ export declare const BASIC_PROPERTIES: {
|
|
|
59
59
|
readonly wav: "ICRD";
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
|
-
readonly
|
|
62
|
+
readonly trackNumber: {
|
|
63
63
|
readonly key: "TRACKNUMBER";
|
|
64
64
|
readonly description: "The track number within the album";
|
|
65
65
|
readonly type: "string";
|
|
@@ -73,7 +73,7 @@ export declare const BASIC_PROPERTIES: {
|
|
|
73
73
|
readonly wav: "ITRK";
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
readonly
|
|
76
|
+
readonly genre: {
|
|
77
77
|
readonly key: "GENRE";
|
|
78
78
|
readonly description: "The musical genre";
|
|
79
79
|
readonly type: "string";
|
|
@@ -87,7 +87,7 @@ export declare const BASIC_PROPERTIES: {
|
|
|
87
87
|
readonly wav: "IGNR";
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
|
-
readonly
|
|
90
|
+
readonly comment: {
|
|
91
91
|
readonly key: "COMMENT";
|
|
92
92
|
readonly description: "Comments or notes about the track";
|
|
93
93
|
readonly type: "string";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basic-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/basic-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"basic-properties.d.ts","sourceRoot":"","sources":["../../../src/constants/basic-properties.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqFnB,CAAC"}
|